Hi everyone!

I recently upsized my Access database to SQL Server (MSDE sp4).
I now have an .adp file which I use to manage the database (an
interface to the MSDE backend) and an mdb file that holds the UI
(forms, etc.). The .mdb file has the MSDE database tables linked to it
through ODBC. The application so far seems to run rather smoothly but
I get a few glitches.

Here is one: I have this code for getting values from TableA and get
them to a new record in TableB. It used to run fine prior to upsizing
but now a get an error message (the db.OpenRecordset "dbSeeChanges"
parameter was added after the upsizing).

     Dim db As DAO.Database, rstI As DAO.Recordset, rstO As DAO.Recordset

      Set db = DBEngine(0)(0)

      Set rstI = db.OpenRecordset("SELECT * FROM TableA WHERE... ;",
dbOpenDynaset, dbSeeChanges)
                           
      Set rstO = db.OpenRecordset("SELECT * FROM TableB;",
dbAppendOnly, dbSeeChanges)

      rstO.AddNew

      rstO!field1 = rstI!field1
      rstO!field2 = rstI!field2
      rstO!field3 = rstI!field3

      rstO.Update

      rstI.Close
      rstO.Close

      Set rstI = Nothing
      Set rstO = Nothing

When I run the code (through a command button) I get the following
error message:

"Run-time error '3251'. Operation is not supported for this type of
object."

The error is pointed to the "rstO.AddNew" statement.

Any clue of what's wrong and how to fix it?

Thanks in advance, Theodore





SPONSORED LINKS
Microsoft access database Database development software Database management software
Database software Inventory database software Membership database software


YAHOO! GROUPS LINKS




Reply via email to