Hi,
I am in the process of trying to sucessfully insert data into our VFP database, from SQL 2005, but I am having some problems.
I have created a linked server to our VFP database, and have successfully inserted data into a test table I created. The problem comes when using our tables which have triggers and default values which get data from another VFP database.
We have a "SYSTEM" database which contains auditing tables and a table that stores the next available primary keys for the tables in our "LIVE" database.
When you insert a record into the "LIVE" database a default value calls a newid() stored procedure that then opens the system database (if it is not already open) and gets the next available ID. On the "LIVE" database there are INSERT and UPDATE triggers that call stored procedures that insert field changes into the system database.
All the above works fine when inserting data from within FoxPro, even if the system database is not open.
Trying to insert from SQL 2005 causes the following (unhelpful) error :
OLE DB provider "VFPOLEDB" for linked server "COMPANYDB" returned message "Unspecified error".
Msg 7343, Level 16, State 2, Line 4
The OLE DB provider "VFPOLEDB" for linked server "COMPANYDB" could not INSERT INTO table "[COMPANYDB]...[companies]".
How can I get this working, or even find where the error is occuring ?
Should I be considering moving all the tables from the "SYSTEM" database and put them in the "LIVE" database? (Not ideal as there are a lot of auditing tables, and I like to keep them separate, as we have Crystal users and all the additional tables will confuse them)
Is the error occuring due to the fact the data provider is only looking at the "LIVE" database. Some advice on this would be great as I am not sure how ODBC/OLEDB would handle the opening of additional databases in stored procedures.
Thanks in advance
Chris
I am in the process of trying to sucessfully insert data into our VFP database, from SQL 2005, but I am having some problems.
I have created a linked server to our VFP database, and have successfully inserted data into a test table I created. The problem comes when using our tables which have triggers and default values which get data from another VFP database.
We have a "SYSTEM" database which contains auditing tables and a table that stores the next available primary keys for the tables in our "LIVE" database.
When you insert a record into the "LIVE" database a default value calls a newid() stored procedure that then opens the system database (if it is not already open) and gets the next available ID. On the "LIVE" database there are INSERT and UPDATE triggers that call stored procedures that insert field changes into the system database.
All the above works fine when inserting data from within FoxPro, even if the system database is not open.
Trying to insert from SQL 2005 causes the following (unhelpful) error :
OLE DB provider "VFPOLEDB" for linked server "COMPANYDB" returned message "Unspecified error".
Msg 7343, Level 16, State 2, Line 4
The OLE DB provider "VFPOLEDB" for linked server "COMPANYDB" could not INSERT INTO table "[COMPANYDB]...[companies]".
How can I get this working, or even find where the error is occuring ?
Should I be considering moving all the tables from the "SYSTEM" database and put them in the "LIVE" database? (Not ideal as there are a lot of auditing tables, and I like to keep them separate, as we have Crystal users and all the additional tables will confuse them)
Is the error occuring due to the fact the data provider is only looking at the "LIVE" database. Some advice on this would be great as I am not sure how ODBC/OLEDB would handle the opening of additional databases in stored procedures.
Thanks in advance
Chris