-
SQL
HI!!
For example, I have this:
sqlwords = "insert into aaaa values('" & txt_name.Text & "'," & Val(txt_number.Text) & ")"
ConectionA.Execute sqlwords
In txt_number.Text I have a number with format. For example: 128.23
But the string named sqlwords, takes this number like 128,23
And the execution fails.
What can I do? Thanks in advance.
-
Re: SQL
remove the Val function as in
Dim sqlwords as string
sqlwords = "insert into aaaa values('" & txtName.Text & "'," & txtNumber.Text & ")"
MsgBox sqlwords
-
Re: SQL
Check the regional configuration of your computer, I had the same problem with this I use date and numbers and received errors in return or just a wrong string
Also if you have in SQL a column with the type number and you are sending a string like this '" & text.text & "' you will receive an error use this for the number type columns " & text.text & "
Hope this helps you
Regards
-
Re: SQL
Use Cdbl instead of using Val function since The val function converts into Numeric value so i suggest you tu use
CDbl where it takes the decimal value in the database
-
Re: SQL
Thanks to all !
The problem was the Val function and the Format function.