HELP! SQL Server 6.5/ADO2/VB6 Question 
Author Message
 HELP! SQL Server 6.5/ADO2/VB6 Question

I am developing an ADO 2 front end written in a mixture of VB and VC++
(mainly VB so far), and need to maintain compatability allowing the user to
use either a central SQL Server database or a local Access database with the
same schema.

So, I developed the database in Access and then used the upsizing wizard to
produce a SQL Server version. No problems. The tables contain Autonumber ID
fields which are converted to Identity fields with a dw_ZeroDefault.

Now the ADO app works fine for the Access database, and reads the SQL Server
database fine too, BUT adding new records to the SQL Server database (using
Recordset.AddNew) results in "Errors Occurred. 80040e21"

I guess this is related to problems with "Attempt to explicitly update
identity field" problems as I have also seen this error message. Although I
am not explicitly setting the identity field, ID. I.e.
...
rs.AddNew
rs.Fields("Name").Value = "HELP!"
rs.Update ' Fail - tried to explicitly alter identity  field
....

I assume this is either a problem with the way the upsizing wizard has
structured the tables/identities or the way in which the SQL Server OLEDB
provider constructs the AddNew query.

Any ideas anyone as I am fresh out of them?

Thanks in advance,

Matt.

Matt Hammond
Application Electronics Limited
Brackley, UK




Sun, 29 Apr 2001 03:00:00 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. Syntax for VB6.0 to access SQL Server 6.5

2. Syntax for VB6.0 to access SQL Server 6.5

3. Update problem with VB6 and SQL Server 6.5

4. SQL Server 6.5 & VB6 ADO

5. VB6: Data Environment & SQL Server 6.5

6. Question regarding Access97 linking to SQL Server 6.5

7. SQL Server 6.5 over Web Questions:

8. Question: SQL Server 6.5, VB5

9. ADO 2.1/SQL Server 6.5 - IDENTITY Question

10. ADO 2.1/SQL Server 6.5 - IDENTITY Question

11. ASP, SQL Server 6.5, VBScript, HELP!!!

12. Help with SQL Server 6.5

 

 
Powered by phpBB® Forum Software