|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Below is an ASP file forminput.asp ... I encountered an error which is described below when I tested the script on IIS... What type of error is it? How can I correct it?
<% Dim cConn, sSQL If Request.Form("posted") = 1 Then 'form posted 'Open the db connection Set cConn = Server.CreateObject ("ADODB.Connection") cConn.Open "test_db","","" 'Build the SQL string sSQL = "INSERT INTO MyUsers (Name, Email)" sSQL = sSQL & " VALUES ('" & Request.Form("Name") & "','" & Request.Form("Email") & "')" 'Execute the SQL cConn.Execute sSQL 'line 12 'Output message Response.Write "<p>Thankyou for signing up. Your information has been added to our database!</p>" Else 'display the form %> <form action="forminput.asp" method="POST"> Your Name <input type="text" name="Name"><br> Your Email <input type="text" name="Email"><br> <input type="hidden" name="Posted" value="1"> <input type="submit" value="Sign Up"> </form> <% End If %> Error Type: Microsoft OLE DB Provider for ODBC Drivers (0x80004005) [Microsoft][ODBC Microsoft Access Driver] Operation must use an updateable query. /portal/testing/forminput.asp, line 12 ![]() |
|
#2
|
||||
|
||||
|
You just need to alter your connection settings.
Set cConn = Server.CreateObject ("ADODB.Connection") cConn.Mode = 3 ' for writing cConn.Open "test_db" Don't forget to close your connection after u use it. cConn.Close set cConn = nothing |
|
#3
|
|||
|
|||
|
If you still get that error after you fix your connection info, then it's a permissions issue. Are you using an Access db or SQL server? If you are using access, you must ensure that user has read and write access to the folder where you have placed the db in.
http://www.aspfaq.com/show.asp?id=2062 |
![]() |
| Viewing: Dev Articles Community Forums > Programming > ASP Development > Error running ASP |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|