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

Re: SQLEXEC is impatient by Remus

Remus
Thu Nov 06 10:41:41 CST 2003

Wayne,
Can you turn on ODBC logging (from Control Panel) and see which function
call is failing? If you can, please turn on logging, start VFP and make the
call, shutdown VFP then turn off logging. The resulted log should indicate
which function returned an error code that could treated as 'out of
resources': HY001 (Memory allocation error), HY013 (Memory management error)
etc. In fact, VFP's AERROR() should contain the exact ODBC error code
returned by the driver and you can look up that code in the log. Based an
what function is failing, maybe you/we can figure out what setting to
change.

HTH,
Remus

"wayne dooley" <spammers@must.die> wrote in message
news:o4jqb.84411$mZ5.582020@attbi_s54...
> 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
>
>
>
>
>
>
>