Jump to content

error in insert query


salman.pirani
 Share

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 comment
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 comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...