Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Sql - insert doesn't work for numeric value?
Message
De
04/04/2005 03:54:18
 
 
À
04/04/2005 03:53:11
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9
OS:
Windows XP SP1
Network:
Windows 2003 Server
Database:
MS SQL Server
Divers
Thread ID:
01001142
Message ID:
01001147
Vues:
20
>Hi Bong,
>
>I don't use SQL server myself, but I see your error. The & macro substitution sign is for text only. Something like
>=SQLExec(gnConnectionHandle, "INSERT INTO [TRANSFILE].[DBO].[ADJFILE] (TNUMBER) VALUES (nTNumber) " )
should work.
>>Hi all!
>>
>>Please check the codes, and help me to find the correct way of doing this, I can't find a solution as I am new to SQL server.
>>
>>In SQL Table
>>DESCRIPTION NVARCHAR (25)
>>TNUMBER FLOAT
>>
>>In FoxPro Form
>>cDescription = AllTrim(Thisform.txtDescription.Value) <--- character value
>>nTNumber = Thisform.txtTNumber.Value <--- numeric value
>>
>>=SQLExec(gnConnectionHandle, "INSERT INTO [TRANSFILE].[DBO].[ADJFILE] (DESCRIPTION) VALUES ('&cDescription') " ) <--- this command works and saves the record
>>
>>=SQLExec(gnConnectionHandle, "INSERT INTO [TRANSFILE].[DBO].[ADJFILE] (TNUMBER) VALUES ('&nTNumber') " ) <--- this command doesn't work
>>
>>Did I miss something here?
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform