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?
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