Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to send update to SQL Server
Message
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Autre
Divers
Thread ID:
00835189
Message ID:
00852918
Vues:
17
Chris,

Your code is lacking error checking.
IF SQLEXEC(gnConnHandle, lcCommand, "curTemp") < 0
  * ODBC error
  * Use AERROR() function to get detailed info about ODBC error
  * Log error or/and do something else
...
ELSE
  ...
ENDIF
>Hi Philip - see if this helps...
>
>
>PUBLIC gnConnHandle
>LOCAL llConnected, lcCommand
>STORE -1 TO gnConnHandle
>STORE .F. TO llConnected
>STORE "" TO lcCommand
>=SQLSETPROP(0, "DispWarning", .F.)
>=SQLSETPROP(0, "DispLogin", 3)
>STORE SQLSTRINGCONNECT("DRIVER=SQL Server;SERVER=PREXP01;UID=user;PWD=pass;
APP=Microsoft® Visual FoxPro®;WSID=PREXP01;DATABASE=Northwind") TO gnConnHandle
>IF gnConnHandle < 0
>   =MESSAGEBOX('Cannot make connection', 16, 'SQL Connect Error')
>ELSE
>   =MESSAGEBOX('Connection made', 48, 'SQL Connect Message')
>   llConnected = .T.
>ENDIF
>IF llConnected THEN
>	lcCommand = "exec CustOrdersOrders 'ALFKI'"
>	=SQLEXEC(gnConnHandle, lcCommand, "curTemp")
>	SELECT curTemp
>	BROWSE
>	USE IN curTemp
>	=SQLDISCONNECT(gnConnHandle)
>ENDIF
>
>
>It calls the CustOrdersOrders stored procedure, passing in the customer id...
--sb--
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform