Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Adding records to access db does not work

Status
Not open for further replies.

tomothy

Technical User
Oct 30, 2001
40
GB
I have writen this script to add a record to an access db but it does not work. This always worked when I was using win98 with PWS but now that i am using winXP pro with IIS it does not work.

<%@ Language=VBScript %>
<% Option Explicit %>
<!--#include virtual=&quot;adovbs.inc&quot;-->
<%
Dim objConn, objRS

Set objConn = Server.CreateObject(&quot;ADODB.Connection&quot;)
objConn.ConnectionString = &quot;DSN=abbadb.dsn&quot;
objConn.Open
Set objRS = Server.CreateObject (&quot;ADODB.Recordset&quot;)
objRS.Open &quot;tblGigs&quot;, objConn, , adLockOptimistic, adCmdTable

objRS.AddNew
objRS(&quot;GigMonth&quot;) = Request.Form(&quot;muMonth&quot;)
objRS(&quot;GigDay&quot;) = Request.Form(&quot;txtDay&quot;)
objRS(&quot;GigYear&quot;) = Request.Form(&quot;txtYear&quot;)
objRS(&quot;GigVenue&quot;) = Request.Form(&quot;txtVenue&quot;)
objRS.Update

objRS.Close
Set objRS = Nothing
objConn.Close
Set objConn = Nothing

Response.Redirect(&quot;..\gigguide.asp&quot;)
%>

The line causing the error is objRS.Update and this is the error i get:

Error Type:
Microsoft OLE DB Provider for ODBC Drivers (0x80004005)
[Microsoft][ODBC Microsoft Access Driver] Operation must use an updateable query.
/abba/gigguide/addgig.asp, line 18

can anyone help me?

Thankyou for your time

Andrew Wieland
 
Check the security permissions on the database folder.
Everyone must be allowed Full Conrol over the folder where you have placed your access database.

Reason :

Whenever a record is added to the access database a temporary file is generated till the transaction is completed. As the http user /everyone does not have the right to create file in your database folder , when you try to insert record into or update the database it returns the error.


[peace]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top