Hi,
Got a bit of a wierd situation. I have some VB code that connects to SQL Server 2000 via OLEDB.
I then use a command object to call an SP to insert values into a table. So far so good.
When the item I am trying to insert already exists in the table, I trap error -2147217873 (Violation of primary key) and report to user that the item they are trying to add already exists.
This works fine when in debug mode on my NT4.0 machine. However when I build the app and run it on a W2K machine, the error number for Violation of Primary Key becomes -2147217900.
I would expect the error number to be the same as I was under the impression that the SQL server generates and returns the error. (Or could it be different MDAC versions / OLEDB versions?)
I can trap both errors but would be happier if I knew why they were different.
Any advice would be much appreciated.
Graeme
"Just beacuse you're paranoid, don't mean they're not after you
Got a bit of a wierd situation. I have some VB code that connects to SQL Server 2000 via OLEDB.
I then use a command object to call an SP to insert values into a table. So far so good.
When the item I am trying to insert already exists in the table, I trap error -2147217873 (Violation of primary key) and report to user that the item they are trying to add already exists.
This works fine when in debug mode on my NT4.0 machine. However when I build the app and run it on a W2K machine, the error number for Violation of Primary Key becomes -2147217900.
I would expect the error number to be the same as I was under the impression that the SQL server generates and returns the error. (Or could it be different MDAC versions / OLEDB versions?)
I can trap both errors but would be happier if I knew why they were different.
Any advice would be much appreciated.
Graeme
"Just beacuse you're paranoid, don't mean they're not after you