|
-
May 16th, 2006, 07:25 AM
#1
Thread Starter
Lively Member
sql syntax help
Hi,
I am trying to insert textbox information into database using a simple SQL query, but it is throwing me an exception with the SQL statement syntax error. I know it should be something simple... but i couldnt.... so need ur inputs on this... here is the code iam working on
where myconn is the connection string to the database.
SQL = "INSERT INTO Table1(f1,f2,f3,f4,f5,f6,f7,f8) VALUES("
SQL = SQL & "'"
SQL = SQL & Text2.Text
SQL = SQL & "'"
SQL = SQL & ","
SQL = SQL & "'"
SQL = SQL & Text3.Text
SQL = SQL & "'"
SQL = SQL & ","
SQL = SQL & "'"
SQL = SQL & Text4.Text
SQL = SQL & "'"
SQL = SQL & ","
SQL = SQL & "'"
SQL = SQL & Text1.Text
SQL = SQL & "'"
SQL = SQL & ","
SQL = SQL & "'"
SQL = SQL & "ABC"
SQL = SQL & "'"
SQL = SQL & ","
SQL = SQL & "'"
SQL = SQL & Format(Now, "yyyymmdd")
SQL = SQL & "'"
SQL = SQL & ","
SQL = SQL & "'"
SQL = SQL & lblTime.Caption
SQL = SQL & "'"
SQL = SQL & ","
SQL = SQL & "'"
SQL = SQL & ""
SQL = SQL & "')"
Myconn.Execute SQL
Myconn.Close
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|