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 biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SQL passthrough getting ARITHABORT error

Status
Not open for further replies.

jlbsloan

Programmer
Mar 1, 2001
45
US
I am using VFP8 and executing an SQL statement which is getting the following error.

"Connectivity Error: ODBC SQL Server Driver .... Insert Failed because the following SET options have incorrect settings: 'ARITHABORT'"

I can copy this exact statement to the Query Analyzer and it runs fine. It is more or less just a single table insert with no mathmatical calculations being performed. Any ideas?
 

ARITHABORT ususally happens because of a numeric overflow. Its behaviour varies according to whether you have also set ARITHIGNORE and ANSI_WARNINGS.

The best way to track this down would be to go to Query Analyzer, and execute sp_configure. This will tell you the settings of each of the above options. (See the Help for info about how to interpret the output from sp_configure).

Then, go back to VFP, and make the same settings for the three options within your SQLExec.

So, if SET ARITHIGNORE is off in QA, you would do something like this in VFP:

lcCmd = "SET ARITHIGNORE OFF INSERT INTO MyTable ... etc?"
SQLExec(nHandle, lcCmd)

I hope that should get you started.

Mike



__________________________________
Mike Lewis (Edinburgh, Scotland)

My sites:
Visual FoxPro (www.ml-consult.demon.co.uk)
Crystal Reports (www.ml-crystal.com)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top