Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Data type mismatch err while updatting numeric field in
Message
 
 
To
24/11/2004 00:58:36
General information
Forum:
Visual FoxPro
Category:
Client/server
Environment versions
Visual FoxPro:
VFP 8 SP1
OS:
Windows 2000
Network:
Windows 2000 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
00964136
Message ID:
00964138
Views:
10
It's much simpler with SPT parameters
cStr = "Insert Into PrtMst(ItmCod,ItmDes,Qty,GrpNo) Values " + ;
 		"(?cItmCod, ?cItmDes, ?nQty, ?nGrpNo)"
cSqlDb.Execute(cStr)
>
>I m trying to insert a numeric and an integer value to the SQL Database
>using SQL Execute Command all Charector type values are upadated properly
>But, when it reach to numeric variable it shows an error that 'Data Type Mismatch Error'.
>Then how will i insert numeric value in to the databse.
>
>Sample code is given below
>cItmCod = 'A1B1C1'
>cItmDes = 'Mechine Part '
> nQty =  100.000 (Numeric)
> nGrpNo = 1 (Integer)
>
> cSqlDb.BeginTrans()
> cStr = "Insert Into PrtMst(ItmCod,ItmDes,Qty,GrpNo) Values
>             ("+"'"+cItmCod+"',"+"'"+cItmDes +"',"+"'"+nQty +"','"+nGrpNo +"')"
>  cSqlDb.Execute(cStr)
>  cSqlDb.CommitTrans
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform