dbTalk Databases Forums  

SQLExec is impatient

comp.databases.xbase.fox comp.databases.xbase.fox


Discuss SQLExec is impatient in the comp.databases.xbase.fox forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
wayne dooley
 
Posts: n/a

Default SQLExec is impatient - 11-05-2003 , 09:20 PM






Hello

I am using VFP 7 to talk to a product called Quickfill, which is accessible
thru its own ODBC drivers and uses a backend called (I believe) DBVista.
I'm having pretty good success, but a few odd things. When I run the code
below, it returns a -1 on SQLEXEC with the message "Connectivity error.
Unable to retrieve specific information. The driver is probably our of
resources" - then it plows ahead and retrieves the results. As you can se I
tried all sorts of SQLSetProp settings to make the thing wait before
going -1 on me, but to no avail. Note that the lock manager and databases
for this product are on a high-end server, oon which I'm also running this
program, so there should not be bandwidth issues. The delay is slight - a
few seconds - but enough so that I get th -1 and thus have no way to trap
legitimate errors. Any ideas? By the way, the "hint" command was
recommended by the software vendor, and works.

thanks
wayne

* for DSN-less connection to Quickfill database
* from file DSN:
cConnStr = "DRIVER=QuickFill ODBC;UID=;PWD=;Database=CRCTS01.ELECTRONIC
PRODUCTS;Server=OpenRDA;Trusted_Connection=Yes"

clear

WAIT WINDOW NOWAIT 'Attempting connection - please wait...'
nConn1 = SQLStringConnect(cConnStr)
wait clear

IF nConn1 < 0
=MESSAGEBOX('Cannot make connection to Quickfill database', 16, 'ODBC
Connect Error')
return
ELSE


cSQL = "select * from pay inner join ord on ord_num = pay_ordnum "
cSQL = cSQL + "where pay_trandate >= '10/24/2003' and ord_ar = 0 hint join
(pay,ord)"

sqlSetProp(nconn1, 'Asynchronous', .F.)
sqlsetProp(nconn1, 'BatchMode', .T.)
sqlSetProp(nconn1, 'DispLogin', 1)
sqlSetProp(nconn1, 'ConnectTimeOut', 15)
sqlSetProp(nconn1, 'DispWarnings', .F.)
sqlSetProp(nconn1, 'IdleTimeOut', 5)
sqlSetProp(nconn1, 'QueryTimeOut', 5)
nRes = SQLEXEC(nConn1, cSQL, 'PAY')
? 'SQLExec result is '
?? nRes

= AERROR(aErrorArray) && Data from most recent error
CLEAR
? 'The error provided the following information' && Display message
FOR n = 1 TO 7 && Display all elements of the array
? aErrorArray(n)
ENDFOR
WAIT WINDOW 'Connection handle is ' + STR(nConn1) + '. Press any key to
disconnect'
nDisconn = SQLDISCONNECT(nConn1)
? 'Disconnect result is '
?? nDisconn
ENDIF








Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.