Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Sent variable as float to SQL Sever
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Problèmes
Divers
Thread ID:
00921474
Message ID:
00921596
Vues:
15
This should work:
SET TEXTMERGE ON
SET TEXTMERGE TO MEMVAR lcQuery NOSHOW
\SELECT * FROM products 
\\  WHERE productname like substring(?m.cProduct,1,<<m.nProductLen>>)
SET TEXTMERGE TO
SET TEXTMERGE OFF
IF SQLExec(nConn,lcQuery,"prod") < 0
   IF AERROR(laError) > 0
      Messagebox("Error trying to select"+chr(13)+laerror[2])
   ENDIF
ENDIF
HTH
>Hi all!

>because the error occurs?

>begin code
>nCon = SQLSTRINGCONNECT("DRIVER=SQL Server;SERVER=MY >SERVER;UID=SA;PWD=;DATABASE=NORTHWIND")

>=SQLEXEC(nCon,"USE NORTHWIND")

>m.cProduct = "Chocolade"
>m.nProductLen = 1
>=SQLEXEC(nCon,"select * from products where productname like "+;
>"substring(?m.cProduct,1,?m.nProductLen)","prod")

>LOCAL laError(5)
>AERROR(laError)
>MESSAGEBOX(laError[1,2])

>* laError[1,2] = Connectivity error: [Microsoft][ODBC SQL Server Driver]
>*[SQL >Server]Argument data type float is invalid for argument 3 of substring >function.
Apoya a Visual FoxPro usandolo legalmente
--
¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º
Espartaco Palma Martínez
SysOp PortalFox
http://www.portalfox.com
esparta@portalfox.com
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform