PDA

Click to See Complete Forum and Search --> : Need help in Inserting values to db


Jony5
Jun 8th, 2000, 02:31 AM
Hi ...
I`m Kindda new here and in the Vbworld i need help !

I Have to insert values to db of acsses 2000
and it dosent work , i tried

con.Execute "insert into tbl1 values (text1,text2,text3,text4)"

Jun 8th, 2000, 06:05 AM
Here are some suggestions.
Make sure the text1...text4 are outside the query string. ex. "Insert into [TableName] Values ('" & text1 & "', '" & text2 & "', '" & text3 & "', '" & text4 & "')"
Make sure your have single quotes around the values like above.

Negative0
Jun 8th, 2000, 11:14 PM
Your INSERT statement is formatted incorrectly, it should look like this:

Con.execute "INSERT INTO tbl1 (field1,field2) VALUES ("'" & text1 & "','"& text2 & "')"

Hope this helps