Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

linkedserver and error trapping

Status
Not open for further replies.

dweldon

Programmer
Joined
Oct 27, 2001
Messages
1
Location
US
Hello,

Could someone please tell me how to trap an OLE/DB error while using a Stored Procedure that executes the OPENQUERY command? What I want to be able to do is know when a table in the Linked Server is not available. The data is in a VFP table and I can cause the error if I first get the table exclusive in FoxPro. It will return the following when I call the sp in Query Analyzer:

Server: Msg 7399, Level 16, State 1, Line 1
OLE DB provider 'MSDASQL' reported an error.
[OLE/DB provider returned message: [Microsoft][ODBC Visual FoxPro Driver]Cannot open file rolls.dbf.]

The sp then stops after the line EXEC (SqlString) in my sp and returns to the Query Analyzer displaying the above message. I'm uncertain as to how to trap the OLE/DB error since @@Error does not seem to set anything.

Thanks for any help.

Darrell
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top