i'm trying to INSERT simple data to database access 2007 using vb.net 2008 but when i click the button insert

it say's Syntax error in INSERT INTO statement

Recommended Answers

It would help if you showed us the code that you are using. Please provide the exact query.

qry = "INSERT INTO mytable (fld1,fld2) " &
      "       VALUES(" & TextBox1.Text   &
      "             ," & TextBox2.Text   & 
      ")"

probably won't help because the actual query depends on the values …

Jump to Post

All 3 Replies

please could u help me

It would help if you showed us the code that you are using. Please provide the exact query.

qry = "INSERT INTO mytable (fld1,fld2) " &
      "       VALUES(" & TextBox1.Text   &
      "             ," & TextBox2.Text   & 
      ")"

probably won't help because the actual query depends on the values from the textbox controls. What we need is

qry = "INSERT INTO mytable (fld1,fld2) " &
      "       VALUES(" & TextBox1.Text   &
      "             ," & TextBox2.Text   & 
      ")"
Debug.WriteLine(qry)

the string that is displayed by Debug.WriteLine. That will show us the actual query text.

please am a begginer in vb.net and i want to use it to create user interface for my library mangement system any help as to hw to start.thanks

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.20 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.