Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Help! Error with SQL synthax

Author  Topic 

yawanur03
Starting Member

1 Post

Posted - 2011-12-04 : 03:43:46
I am creating a vb program with mysql dataase. i keep getting a sql synthax error. here's my code:

sql = "INSERT INTO dbtarantula VALUES(" & txtgen_serial.Text & ",'" & _
txtgen_scientific_name.Text & "','" & txtgen_common_name.Text & "'," & _
txtgen_size.Text & ",'" & selectedgender & "','" & dtpgen_last_maintained.Text & _
"','" & dtpgen_last_fed.Text & "','" & combogen_captive_bred.Text & "','" & txtpic_comments.Text & "')"

is there an easier way to debug it?
Thanks in advance!

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2011-12-04 : 04:18:45
if you're using mysql please post in mysql forums. this is ms sql server forums so solutions given here are guaranteed to work only in sql server

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

nigelrivett
Master Smack Fu Yak Hacker

3385 Posts

Posted - 2011-12-05 : 06:05:31
Print out the statement - that will usually shouw you where the problem is.
If not run it on the database - if that works then the problem is with the interface rather than the statement.

==========================================
Cursors are useful if you don't know sql.
SSIS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page
   

- Advertisement -