Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
ODBC error and AERROR()
Message
De
01/10/1997 11:58:24
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Client/serveur
Titre:
ODBC error and AERROR()
Divers
Thread ID:
00052673
Message ID:
00052673
Vues:
84
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.
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform