help! syntax error INSERT INTO..
-
Error Type: Microsoft JET Database Engine (0x80040E14) Syntax error in INSERT INTO statement. /insert.asp, line 26 <% ' Declaring variables Dim name, address, age, income, data_source, con, sql_insert Function ChkString(string) If string = "" Then string = " " ChkString = Replace(string, "'", "''") End Function ' Receiving values from Form name = ChkString(Request.Form("name")) address = ChkString(Request.Form("address")) age = ChkString(Request.Form("age")) income = ChkString(Request.Form("income")) data_source = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & Server.MapPath("db1.mdb") sql_insert = "insert into user (name, address, age, income) values ('" & name & "', '" & address & "', '" & age & "', '" & income & "')" ' Creating Connection Object and opening the database Set con = Server.CreateObject("ADODB.Connection") con.Open data_source con.Execute sql_insert ' Done. Close the connection con.Close Set con = Nothing %> bobolov
-
Error Type: Microsoft JET Database Engine (0x80040E14) Syntax error in INSERT INTO statement. /insert.asp, line 26 <% ' Declaring variables Dim name, address, age, income, data_source, con, sql_insert Function ChkString(string) If string = "" Then string = " " ChkString = Replace(string, "'", "''") End Function ' Receiving values from Form name = ChkString(Request.Form("name")) address = ChkString(Request.Form("address")) age = ChkString(Request.Form("age")) income = ChkString(Request.Form("income")) data_source = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & Server.MapPath("db1.mdb") sql_insert = "insert into user (name, address, age, income) values ('" & name & "', '" & address & "', '" & age & "', '" & income & "')" ' Creating Connection Object and opening the database Set con = Server.CreateObject("ADODB.Connection") con.Open data_source con.Execute sql_insert ' Done. Close the connection con.Close Set con = Nothing %> bobolov