Jump to content

error in insert query


Recommended Posts

dear sir db is corect query is corect i dnt knw whr is the error out putG:\wwwroot2\hr\tform\admin\webdata\course.mdbError code -2147467259INSERT INTO course (pt,course_owner,training_cordinator) VALUES ('sss','w','w')

<%set conn=Server.CreateObject("ADODB.Connection")conn.Provider="Microsoft.Jet.OLEDB.4.0"conn.Open(Server.MapPath("webdata/course.mdb"))response.Write(Server.MapPath("webdata/course.mdb"))sql="INSERT INTO course (pt,course_owner,"sql=sql & "training_cordinator)"sql=sql & " VALUES "sql=sql & "('" & Request.Form("pt") & "',"sql=sql & "'" & Request.Form("course_owner") & "',"sql=sql & "'" & Request.Form("training_coo") & "')"    on error resume nextconn.Execute sql,recaffectedif err<>0 then    Response.Write("Error code " & err)else   Response.Write("<h3> Programme Title has been created</h3>")end ifresponse.Write(sql)  conn.close%>

Link to post
Share on other sites

have made some chnages but still having this error plz help Error code -2147467259

<%set conn=Server.CreateObject("ADODB.Connection")strConnect = "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("/hr/tform/admin/webdata/course.mdb")'set db=server.createobject("adodb.connection")conn.connectiontimeout=120conn.open strConnectset rs=Server.CreateObject("ADODB.recordset")'conn.Provider="Microsoft.Jet.OLEDB.4.0"'conn.Open(Server.MapPath("webdata/course.mdb"))'conn.Open("G:\wwwroot2\hr\tform\admin\webdata\course.mdb")sql="INSERT INTO course (pt,course_owner,"sql=sql & "training_cordinator)"sql=sql & " VALUES "sql=sql & "('" & Request.Form("pt") & "',"sql=sql & "'" & Request.Form("course_owner") & "',"sql=sql & "'" & Request.Form("training_coo") & "')"    on error resume nextconn.Execute sql,recaffectedif err<>0 then  Response.Write("Error code " & err)else   Response.Write("<h3> Programme Title has been created</h3>")end if  conn.close%>

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...