K
Kyle O via AccessMonster.com
I wish I could be calmer while I write this but I'm about ready to start
throwing stuff out of aggrivation. I'm trying to add a record to a SQL table
that has an identity feild (ohh no! That never happens!) through programming,
but nothing I've tried has been successful.
Here's the jist of what I'm trying to do: I have a form in Access 2003 that
grabs data from text boxes and places them in 9 different tables ( all
related by an ID column) which are linked to a SQL Server 2000 database. I
can't combine these tables into one, so don't ask. I want to add a record to
the parent table which contains an ID field that is an identity in SQL Server
2000. I use ADO and I get a run-time error (3251) that says "Operation is
not supported for this type of object" when I go into debug, it highlights
the Open method of my recordset object, which is as follows:
rst.Open "Business Information", CurrentDb.Connection, adOpenDynamic,
adLockOptimistic
Then I tried using ADO again, this time I created a connection object that
points to the SQL server and used that for the connection property of the
Open method. Well, I get a run-time error whenever I try to call the update
and close methods and when I use just the addnew method, it doesn't add a new
record - it does nothing.
So I switched to DAO and gave that a try. Ohh this made me want to pour hot
soup in my eyes. I run the OpenRecordset method of the CurrentDb object and
I get a run-time error (3622): "You must use the dbSeeChanges option with
OpenRecordset when accessing a SQL Server Table that has an IDENTITY column."
Here's the method:
Set rst = CurrentDb.OpenRecordset("Business Information")
So, going with the advice of the compiler, I placed dbSeeChanges as one of
the option arguments in the method call. Guess what? I got the same error...
I have no idea where to go, my patience and tolerance has run out. I can add
records through the table view in Access, but I can't be opening tables
onscreen while people are trying to data enter. If anybody has any advice or
possible solution, please tell me.
-Kyle
throwing stuff out of aggrivation. I'm trying to add a record to a SQL table
that has an identity feild (ohh no! That never happens!) through programming,
but nothing I've tried has been successful.
Here's the jist of what I'm trying to do: I have a form in Access 2003 that
grabs data from text boxes and places them in 9 different tables ( all
related by an ID column) which are linked to a SQL Server 2000 database. I
can't combine these tables into one, so don't ask. I want to add a record to
the parent table which contains an ID field that is an identity in SQL Server
2000. I use ADO and I get a run-time error (3251) that says "Operation is
not supported for this type of object" when I go into debug, it highlights
the Open method of my recordset object, which is as follows:
rst.Open "Business Information", CurrentDb.Connection, adOpenDynamic,
adLockOptimistic
Then I tried using ADO again, this time I created a connection object that
points to the SQL server and used that for the connection property of the
Open method. Well, I get a run-time error whenever I try to call the update
and close methods and when I use just the addnew method, it doesn't add a new
record - it does nothing.
So I switched to DAO and gave that a try. Ohh this made me want to pour hot
soup in my eyes. I run the OpenRecordset method of the CurrentDb object and
I get a run-time error (3622): "You must use the dbSeeChanges option with
OpenRecordset when accessing a SQL Server Table that has an IDENTITY column."
Here's the method:
Set rst = CurrentDb.OpenRecordset("Business Information")
So, going with the advice of the compiler, I placed dbSeeChanges as one of
the option arguments in the method call. Guess what? I got the same error...
I have no idea where to go, my patience and tolerance has run out. I can add
records through the table view in Access, but I can't be opening tables
onscreen while people are trying to data enter. If anybody has any advice or
possible solution, please tell me.
-Kyle