quyen Posted December 6, 2005 Share Posted December 6, 2005 I'm having serious problems trying to insert data into a ms access database. everytime i submit the data, they don't get inserted into my ms access table. I think I don't have permission to insert data into the ms access table, but I don't know how to change the settings so that I can just simple insert data into my table. Any help as to the step-by-step procedure to solve my problem will be received with great thankshere's the code. the actual form part is from another asp page. This page does the actual inserting of data into table:<%set conn=Server.CreateObject("ADODB.Connection")conn.Open "Forum"set rs=Server.CreateObject("ADODB.recordset")%><html><body><%sql="INSERT INTO forum1 (PosterName,Date,Comments,"sql=sql & " VALUES "sql=sql & "('" & Request.Form("name") & "',"sql=sql & "('" & Request.Form("date") & "',"sql=sql & "'" & Request.Form("comment") & "')"on error resume nextconn.Execute sql,recaffectedif err<>0 then Response.Write("No update permissions!")else Response.Write("<h3>" & recaffected & " record added</h3>")end ifconn.close%></body></html> Link to comment Share on other sites More sharing options...
denny911 Posted December 6, 2005 Share Posted December 6, 2005 sql=sql & "'" & Request.Form("comment") & "')"You see, i think the problem might be in this:sql=sql & "'" & Request.Form("comment") & "')" (there is no ";" after closing bracket..Try insert it:sql=sql & "'" & Request.Form("comment") & "');"and let me know if that was the problem. Link to comment Share on other sites More sharing options...
quyen Posted December 8, 2005 Author Share Posted December 8, 2005 You see, i think the problem might be in this:sql=sql & "'" & Request.Form("comment") & "')" (there is no ";" after closing bracket..Try insert it:sql=sql & "'" & Request.Form("comment") & "');"and let me know if that was the problem.<{POST_SNAPBACK}> Thanks for you reply. But it has not solved the problem. Having searched high and low around the world I am still not able to progress pass this dead lock which is sucking the life out of me! Link to comment Share on other sites More sharing options...
Guest jibybabu Posted December 11, 2005 Share Posted December 11, 2005 hai, i have also the same problem.i am in a work and i cannot go abroad due to this error.so if you get the solution please inform me through my email id.my email id is jiby.coder4u@gmail.com .please infom me ,,,pleasee........ Link to comment Share on other sites More sharing options...
sorex Posted December 12, 2005 Share Posted December 12, 2005 get rid ofon error resume nextand you'll see what's causing it.btw, you also have a braket too much intheresql=sql & "('" & Request.Form("date") & "'," Link to comment Share on other sites More sharing options...
sunilkumarpt Posted December 19, 2005 Share Posted December 19, 2005 I'm having serious problems trying to insert data into a ms access database. everytime i submit the data, they don't get inserted into my ms access table. I think I don't have permission to insert data into the ms access table, but I don't know how to change the settings so that I can just simple insert data into my table. Any help as to the step-by-step procedure to solve my problem will be received with great thankshere's the code. the actual form part is from another asp page. This page does the actual inserting of data into table:<%set conn=Server.CreateObject("ADODB.Connection")conn.Open "Forum"set rs=Server.CreateObject("ADODB.recordset")%><html><body><%sql="INSERT INTO forum1 (PosterName,Date,Comments,"sql=sql & " VALUES "sql=sql & "('" & Request.Form("name") & "',"sql=sql & "('" & Request.Form("date") & "',"sql=sql & "'" & Request.Form("comment") & "')"on error resume nextconn.Execute sql,recaffectedif err<>0 then Response.Write("No update permissions!")else Response.Write("<h3>" & recaffected & " record added</h3>")end ifconn.close%></body></html><{POST_SNAPBACK}> <%set rs=Server.CreateObject("ADODB.Connection")rs.Open "Forum"%><html><body><%rs("posterName")=Request.Form("Name")rs("Date")=Request.Form("date")rs("Comments")=Request.Form("comment")rs.updateconn.close%></body></html> Link to comment Share on other sites More sharing options...
dhsd6061 Posted December 20, 2005 Share Posted December 20, 2005 Have you ever been able to do an INSERT query against this database in this web? If not, your permissions may not be correctly set.1. Right mouse click the access database icon.2. click properties3. select security tab4. click 'everyone' and view the permissions in window below.5. if the box next to 'write' is unchecked, check it6. ok7. Try query again.The above assumes you are on win2000I also suggest removing the 'on error resume next'. You need to know what error is being caused. Simple syntax stuff can drive you crazy without a little help.good luck.chris 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