Zydeceltico
Registered User.
- Local time
- Today, 11:20
- Joined
- Dec 5, 2017
- Messages
- 843
Hi all -
I am wading into Recordsets and trying to learn how to use them.
I am seeing some examples that use DAO and others that use ADO and it doesn't appear that the syntax is the same which is - of course - confusing.
I already have a substantial amount of DAO.Recordset instances in my db and everything works great - because I was "unaware" until just this very moment that ADO may be a better fit for what I am doing.
Since our company's ERP is SQL Server based I think it would be prudent to make sure that what I am coding at least has the opportunity to "play well" with the ERP in the future.
Can someone tell me the basic differences between the two so I can get an idea of if it is worth working through or not?
As an example I use the following quite often as boiler plate:
How would I need to modify that to be ADO compliant? And would I need to learn a whole new set of methods? (e.g., FindFirst, FindLast, etc.)
Thanks,
Tim
I am wading into Recordsets and trying to learn how to use them.
I am seeing some examples that use DAO and others that use ADO and it doesn't appear that the syntax is the same which is - of course - confusing.
I already have a substantial amount of DAO.Recordset instances in my db and everything works great - because I was "unaware" until just this very moment that ADO may be a better fit for what I am doing.
Since our company's ERP is SQL Server based I think it would be prudent to make sure that what I am coding at least has the opportunity to "play well" with the ERP in the future.
Can someone tell me the basic differences between the two so I can get an idea of if it is worth working through or not?
As an example I use the following quite often as boiler plate:
Code:
Dim rs As DAO.Recordset
If Not Trim(Me.OpenArgs & " ") = "" Then
Set rs = Me.Recordset
rs.FindLast "InspectionEvent_FK = " & CLng(Me.OpenArgs)
If rs.NoMatch Then 'it does not exist so you need to create it
DoCmd.GoToRecord acDataForm, Me.Name, acNewRec
Me.InspectionEvent_FK = Me.OpenArgs
How would I need to modify that to be ADO compliant? And would I need to learn a whole new set of methods? (e.g., FindFirst, FindLast, etc.)
Thanks,
Tim