longmatch
Programmer
- Nov 1, 2001
- 406
I am using ADODC control to access the database, but I did not bind the controls in my form to the backend database. Therefore I have to manipulate data by writing codes for example, addnew, update, navigate. How can I write this kind of program? Do I need to create recordset in each event? if not, how can I do it?
I wrote this pieces of code for navigation, it did not work. Need help me to troubleshoot.
Thanks
Haijun
Private Sub cmdLeft_Click()
Dim strSelectDailycare As String
strSelectDailycare = "select * from tblDailycare where admitID = " & txtAdmissionID
Adodc6.CommandType = adCmdText
Adodc6.RecordSource = strSelectDailycare
Adodc6.Refresh
Print Adodc6.Recordset.RecordCount
If Adodc6.Recordset.AbsolutePosition = adPosEOF Then
Adodc6.Recordset.MoveLast
Else
Adodc6.Recordset.MoveNext
End If
End Sub
I wrote this pieces of code for navigation, it did not work. Need help me to troubleshoot.
Thanks
Haijun
Private Sub cmdLeft_Click()
Dim strSelectDailycare As String
strSelectDailycare = "select * from tblDailycare where admitID = " & txtAdmissionID
Adodc6.CommandType = adCmdText
Adodc6.RecordSource = strSelectDailycare
Adodc6.Refresh
Print Adodc6.Recordset.RecordCount
If Adodc6.Recordset.AbsolutePosition = adPosEOF Then
Adodc6.Recordset.MoveLast
Else
Adodc6.Recordset.MoveNext
End If
End Sub