M
mw
If anyone could give me some help that would be great! I've been programming for years but I'm new to access and figuring out ADO and DAO is quite confusing ... your help would be much appreciated!!!
I'm having trouble binding an ADO recordset to a form. Should I even be doing this? I've referred to (KB 281998), but here's the problem: I want the recordset to be adOpenDynamic (so the user can use custom buttons to do prev/next/top/bottom/find and view all of the updated records using the form). When I use code (like this below) the locktype is reset to adOpenStatic??
Private Sub Form_Open(Cancel As Integer
Dim strPath As Strin
Dim strSQL As Strin
Dim cn As ADODB.Connectio
Dim Defrst As ADODB.Recordse
On Error GoTo ErrorHandle
Set Defrst = New ADODB.Recordse
strpath = "C:\test\test.mdb
Set cn = New ADODB.Connectio
Set cn = CurrentProject.AccessConnectio
' tried this at one time ... still got adOpenStati
' With c
' .Provider = "Microsoft.Access.OLEDB.10.0
' .CursorLocation = adUseServe
' .Properties("Data Provider").Value = "Microsoft.Jet.OLEDB.4.0
' .Properties("Data Source").Value = strpat
' .Ope
' End Wit
strSQL = "SELECT * From Address ORDER BY last_name
With Defrs
Set .ActiveConnection = c
.Source = "SELECT * From Address ORDER BY last_name
.LockType = adLockOptimisti
.CursorType = adOpenDynami
.CursorLocation = adUseServe
.Ope
End Wit
Set Me.Recordset = Defrs
Set Defrst = Nothin
Set cn = Nothin
GoTo Don
ErrorHandler
MsgBox Err.Descriptio
Done
End Su
Thanks again
I'm having trouble binding an ADO recordset to a form. Should I even be doing this? I've referred to (KB 281998), but here's the problem: I want the recordset to be adOpenDynamic (so the user can use custom buttons to do prev/next/top/bottom/find and view all of the updated records using the form). When I use code (like this below) the locktype is reset to adOpenStatic??
Private Sub Form_Open(Cancel As Integer
Dim strPath As Strin
Dim strSQL As Strin
Dim cn As ADODB.Connectio
Dim Defrst As ADODB.Recordse
On Error GoTo ErrorHandle
Set Defrst = New ADODB.Recordse
strpath = "C:\test\test.mdb
Set cn = New ADODB.Connectio
Set cn = CurrentProject.AccessConnectio
' tried this at one time ... still got adOpenStati
' With c
' .Provider = "Microsoft.Access.OLEDB.10.0
' .CursorLocation = adUseServe
' .Properties("Data Provider").Value = "Microsoft.Jet.OLEDB.4.0
' .Properties("Data Source").Value = strpat
' .Ope
' End Wit
strSQL = "SELECT * From Address ORDER BY last_name
With Defrs
Set .ActiveConnection = c
.Source = "SELECT * From Address ORDER BY last_name
.LockType = adLockOptimisti
.CursorType = adOpenDynami
.CursorLocation = adUseServe
.Ope
End Wit
Set Me.Recordset = Defrs
Set Defrst = Nothin
Set cn = Nothin
GoTo Don
ErrorHandler
MsgBox Err.Descriptio
Done
End Su
Thanks again