Jump to content

need serious help on asp and ms access


quyen
 Share

Recommended Posts

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

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

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.

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

Guest jibybabu

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

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>

<%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

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

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...