Results 1 to 3 of 3

Thread: Need help in Inserting values to db

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Jun 2000
    Posts
    27

    Unhappy

    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)"




  2. #2
    Guest
    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.

  3. #3
    PowerPoster 2.0 Negative0's Avatar
    Join Date
    Jun 2000
    Location
    Southeastern MI
    Posts
    4,367

    INSERT Incorrect

    Your INSERT statement is formatted incorrectly, it should look like this:

    Code:
    Con.execute "INSERT INTO tbl1 (field1,field2) VALUES ("'" & text1 & "','"& text2 & "')"
    Hope this helps

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width