Running UPDATE queries doesn't require recordset variables in any case, but here goes:
DoCmd.RunSQL "UPDATE etc"
You could also add an ADO reference to your Access 97 database (CTRL-G, Tools->References) and your above code would probably work with some modifications.
I have little direct experience with 2000, but the general gist is that 2000 onwards are de-emphasizing using DAO for data manipulation in favor of ADO-based access. This, in turn, allows for a smoother introduction into the world of server databases and such.
What I'm saying is that Access 97 will by default assume you are connecting to an Access 97 MDB backend, whereas 2000+ assumes that you are not. Case in point: ADO is not referenced at all by default in 97, but in 2000 it receives priority over the similar DAO library.
I believe DoCmd.RunSQL is still in 2000+, so you can use it for a lot of things. There are reasons not to use it, such as lack of error handling, but it works.
SELECT queries DO return a recordset, so use your above method to grab the recordset.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.