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

sqlexec + sql server inconsistent results

Status
Not open for further replies.

fruityBoy

Programmer
Jul 21, 2000
51
0
0
GB
Hi

I've got a VFP7 front end which talks to Microsoft SQL Server 2005.

I use sqlexec to pass queries to the database in order to produce report information.

Most of the time, this is fine, however, on occassion, sqlexec will return -1, and the results cursor is not created. If I run the query again straight away, then more often than not it returns the data (this is exactly the same query).

I re-created the issue on the command line. What I saw happening was that Foxpro was receiving data (I could tell this by the record count on the status bar), however, -1 would be returned, and a cursor would not be created.

This is extremely hard to reproduce as it does not occur consistently.

This problem occurs with large and small queries. It does seem to happen more when the SQL server is under load, but my timeouts are set to indefinite, and it seems strange that Foxpro does indicate that it is receiving data and then abruptly stops. In addition, Foxpro can sit for a good few seconds before returning -1, but it can also return -1 almost straight away.

The software is installed at 20+ sites, with different server hardware,etc, different customers.

Has anybody else encountered anything similar to this?

I do take this into account by the way, and re-query on failure,it's just not something that I would expect unless there was an error with the query, but there is not!

Thanks for your help.

Regards

Simon
 
Hi Mike

Thanks for your info! I didn't know that aerror returned ODBC error information even though it's not a trapped Foxpro error (ie 1526). I'll build some diagnostics with this and see what I get back.

Thanks for your help

Simon
 
I've successfully trapped the ODBC error,the only information I get is :

Connectivity error: Unable to retrieve specific error information. Driver is probably out of resources

I'm going to use SQL Server tracing to see if I can track any more information.

Simon

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top