Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQL Server and CursorAdapter
Message
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Network:
Windows 2000 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01027717
Message ID:
01027733
Views:
22
>I've got a situation where I'm creating and saving multiple records to a SQL Server table and in one table I have no problems. The PK field in that table is set as an Identity column and when I attempted to add three records with nothing in that column (you know, not zero, not null, just "nothing"). It barfed and said the column would not accept nulls. So I specifically replaced the field in each record with zero. Then it saved just fine. However, on the second table, where it seems to be set up the same way, I can't get it to work. I got the "can't accept nulls" error, but replacing that field with a zero for each record causes an error that reads:
>
>Connectivity error: [Microsoft][ODBC SQL Server Driver][SQL Server]Cannot insert explicit value for identity column in table 'project' when IDENTITY_INSERT is set to OFF.
>
>So inserting multiple records in the first column with an "explicit" value of zero (which really will be changed to some other value SQL Server determines) works fine, but in the second table SQL Server does not like it. As I mentioned, both tables seem to be set up the same: an ID column defined as BigInt and with this column set as an Identity column.
>
>Any thoughts would be appreciated.
>
>Russell Campbell

Just remove that field from CA.UpdateNameList and CA.UpdatableFieldList
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform