salman.pirani Posted December 5, 2012 Share Posted December 5, 2012 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 More sharing options...
justsomeguy Posted December 5, 2012 Share Posted December 5, 2012 You should remove the on error resume next line. If there's an error the program should quit with an error message, not keep going. If you research that error code it looks like it means it can't find the file. Link to comment Share on other sites More sharing options...
salman.pirani Posted December 7, 2012 Author Share Posted December 7, 2012 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 More sharing options...
justsomeguy Posted December 7, 2012 Share Posted December 7, 2012 It's the same error code, so it's the same answer. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now