Click here to Skip to main content
15,924,507 members
Home / Discussions / Database
   

Database

 
QuestionCondition as parameter of sp ... ? [modified] Pin
devboycpp10-Sep-06 23:22
devboycpp10-Sep-06 23:22 
AnswerRe: Condition as parameter of sp ... ? Pin
_AK_10-Sep-06 23:29
_AK_10-Sep-06 23:29 
GeneralRe: Condition as parameter of sp ... ? [modified] Pin
devboycpp10-Sep-06 23:38
devboycpp10-Sep-06 23:38 
GeneralRe: Condition as parameter of sp ... ? Pin
_AK_10-Sep-06 23:55
_AK_10-Sep-06 23:55 
GeneralRe: Condition as parameter of sp ... ? Pin
devboycpp11-Sep-06 0:24
devboycpp11-Sep-06 0:24 
GeneralRe: Condition as parameter of sp ... ? Pin
_AK_11-Sep-06 0:33
_AK_11-Sep-06 0:33 
AnswerRe: Condition as parameter of sp ... ? Pin
Eric Dahlvang11-Sep-06 3:08
Eric Dahlvang11-Sep-06 3:08 
QuestionNavigation buttons Pin
Ranjita Ghosh10-Sep-06 21:41
Ranjita Ghosh10-Sep-06 21:41 
Hi Everybody!
I am using VB6.0 & SQL Server 7.0
Following is my database Connection code

Dim db As ADODB.Connection
Dim rs As ADODB.Recordset
Dim sql As String

Set db = New ADODB.Connection
db.Provider = "SQLOLEDB"
db.ConnectionString = "server=SUNANDA;uid=sa;pwd=ranjita1;database=crm"
db.Open

Set rs = New ADODB.Recordset
sql = "Select * from AccountHead"
Set rs.ActiveConnection = db
rs.CursorLocation = adUseClient
rs.CursorType = adOpenStatic
rs.LockType = adLockOptimistic
rs.Open sql, , , , adCmdText

I have placed navigation buttons on my form, but the Next & Previous buttons are not working properly.
When I first time clicks the Next button , the recordset goes to the next record but when I click it second time, the record doesn’t get changed.

When I press the previous button, the recordset points to the first record, instead of pointing to the previous record.

Here is my code for navigational buttonsSniff | :^) :

Public Sub MoveFields()
txtAcId.Text = rs("AcHeadID")
txtAcName.Text = rs("AcHeadName")
txtAcMobile.Text = rs("Mobile")
txtAcEmail.Text = rs("EmailID")
End Sub

Private Sub cmdFirst_Click()
rs.MoveFirst
MoveFields
cmdPrev.Enabled = False
cmdNext.Enabled = True
End Sub

Private Sub cmdLast_Click()
rs.MoveLast
MoveFields
cmdNext.Enabled = False
cmdPrev.Enabled = True
End Sub

Private Sub cmdNext_Click()
rs.MoveNext
If rs.EOF Then
rs.MoveLast
cmdNext.Enabled = False
End If
MoveFields
cmdPrev.Enabled = True
End Sub

Private Sub cmdRemove_Click()
rs.Delete
rs.MoveNext
If rs.EOF Then
rs.MoveLast
End If
End Sub

Private Sub cmdPrev_Click()
rs.MovePrevious
If rs.BOF Then
rs.MoveFirst
cmdPrev.Enabled = False
End If
MoveFields
cmdNext.Enabled = True
End Sub

Pls. tell me, where I am wrong.
Thanks

AnswerRe: Navigation buttons Pin
Tushar Kothari11-Sep-06 1:06
Tushar Kothari11-Sep-06 1:06 
GeneralRe: Navigation buttons Pin
Ranjita Ghosh11-Sep-06 1:48
Ranjita Ghosh11-Sep-06 1:48 
QuestionCatching errors raised by SP Pin
Uma Kameswari10-Sep-06 21:40
Uma Kameswari10-Sep-06 21:40 
AnswerRe: Catching errors raised by SP Pin
Tushar Kothari11-Sep-06 1:10
Tushar Kothari11-Sep-06 1:10 
GeneralRe: Catching errors raised by SP Pin
Amit Kumar G12-Sep-06 16:28
Amit Kumar G12-Sep-06 16:28 
QuestionCannot edit the existing record Pin
Ranjita Ghosh10-Sep-06 21:09
Ranjita Ghosh10-Sep-06 21:09 
AnswerRe: Cannot edit the existing record Pin
Tushar Kothari11-Sep-06 1:13
Tushar Kothari11-Sep-06 1:13 
GeneralRe: Cannot edit the existing record Pin
Ranjita Ghosh11-Sep-06 1:36
Ranjita Ghosh11-Sep-06 1:36 
GeneralRe: Cannot edit the existing record Pin
Tushar Kothari11-Sep-06 1:39
Tushar Kothari11-Sep-06 1:39 
GeneralRe: Cannot edit the existing record Pin
Ranjita Ghosh11-Sep-06 1:51
Ranjita Ghosh11-Sep-06 1:51 
GeneralRe: Cannot edit the existing record Pin
Tushar Kothari11-Sep-06 2:14
Tushar Kothari11-Sep-06 2:14 
Questionhow i populate the row of datagridview in edit mode Pin
tutum10-Sep-06 20:16
tutum10-Sep-06 20:16 
QuestionStored Procedure Pin
Uma Kameswari10-Sep-06 18:50
Uma Kameswari10-Sep-06 18:50 
AnswerRe: Stored Procedure Pin
_AK_10-Sep-06 20:58
_AK_10-Sep-06 20:58 
GeneralRe: Stored Procedure Pin
Amit Kumar G12-Sep-06 16:30
Amit Kumar G12-Sep-06 16:30 
GeneralRe: Stored Procedure Pin
_AK_12-Sep-06 19:36
_AK_12-Sep-06 19:36 
QuestionMethod for partially updating databases in ADO.NET? Pin
dy1310-Sep-06 17:38
dy1310-Sep-06 17:38 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.