Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
ODBC error and AERROR()
Message
From
01/10/1997 11:58:24
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Client/server
Title:
ODBC error and AERROR()
Miscellaneous
Thread ID:
00052673
Message ID:
00052673
Views:
79
Hi everybody,

I am using SQL passthrough for a query to SQL Server. When I hit a connectivity error and try to get the error messages through AERROR() the array doesn't get created. More specifically, I get a connection handle, but don't get a result set (due to server side problems). If I run this code from the command window, AERROR(laerror) will create the array exactly like it is supposed to, but running it from the .prg doesn't work.

My code is below:

lcsql = DBGETPROP('cnstproj', 'view', 'sql')
lcsql = STRTRAN(lcsql, '?SYSCODES', syscodes)

lnhandle = SQLCONNECT(datasource, username, password)
public laerror(1)
IF lnhandle > 0
* we have a connection
lnsuccess = SQLEXEC(lnhandle, lcsql, 'cnstproj')
=SQLDISCONNECT(lnhandle)
ELSE
lnsuccess = -1
ENDIF
IF lnsuccess < 1
AERROR(laerror)
** do something with it
ENDIF

Any ideas?

Thanks much.
Next
Reply
Map
View

Click here to load this message in the networking platform