BillNorton
Registered User.
- Local time
- Today, 16:17
- Joined
- May 23, 2001
- Messages
- 27
After a hiatus of a few years I find myself back writing Access applications, so I need to get caught up a bit.
First of all help me out with the whole ADO, DAO RunSQL thing. In the past whenever I needed to do any database operations I almost always used straight SQL with DoCmd.RunSQL, e.g.:
Most other coders seem to use some recordset approach, e.g:
The only time I ever used recordsets was when I needed to loop through each record and apply some logic that was too convoluted for SQL or at least too convoluted for me to write in SQL.
So, what's the advantage of using recordsets - whether ADO or DAO - over RunSQL?
First of all help me out with the whole ADO, DAO RunSQL thing. In the past whenever I needed to do any database operations I almost always used straight SQL with DoCmd.RunSQL, e.g.:
Code:
lsSQL = "INSERT INTO tblUsers CenterID, WorkerID..."
DoCmd.RunSQL (lsSQL)
Most other coders seem to use some recordset approach, e.g:
Code:
Set rst = dbs.OpenRecordset("tblUsers")
rst.AddNew
rst("ClientID") = Me.ClientID.Value
rst("WorkerID") = Me.WorkerID.Value
...
rst.Update
The only time I ever used recordsets was when I needed to loop through each record and apply some logic that was too convoluted for SQL or at least too convoluted for me to write in SQL.
So, what's the advantage of using recordsets - whether ADO or DAO - over RunSQL?