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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can't update database from ASP Call

Status
Not open for further replies.

Charlix

Programmer
Nov 19, 2002
85
US
When I call the following dll from my ASP page. I get error message
“Microsoft JET Database Engine error '80040e09'
Cannot update. Database or object is read-only. “
*******************

Public Function setVisitor(ByVal userName As Variant, ByVal password As Variant) As Variant

Dim adoConnection As ADODB.Connection
Dim adoRecordset As ADODB.Recordset
Dim connectString As String

connectString = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=C:\ clients.mdb"

Set adoConnection = New ADODB.Connection
Set adoRecordset = New ADODB.Recordset

adoConnection.Open connectString
adoRecordset.Open "SELECT * FROM SiteVisitors", adoConnection, _
adOpenDynamic, adLockOptimistic

With adoRecordset
.AddNew
!previousVisit = Now()
.Update
End With

'-- Return a unique ID so we can set the cookie
setVisitor = adoRecordset!cookieID

'-- Close the recordset and the connection
adoRecordset.Close
adoConnection.Close

End Function
******************

When I test this function as a stand alone, it operates perfectly, so it must be something with configuring permissions on my website. I have gone to Microsoft Management Console (MMC) but I don’t see anywhere to give read-write permissions, if this is what I need to do.

Thanks for any help.

Charlix
 
Sounds like a permisions error -

take the database out of the root of c:
give it its own folder
change the folder permissions to read / write for 'everyone'
 
to simonchrities:
I put the database in its own folder. I right clicked on the folder to remove the read only attribute but when I right click again, I find the read only attribute still there.

I still get the same error message that I can't update the database when I call the dll from my asp page. What's up?

charliz
 
try

right click folder
select properties
select security
allow 'everyone' full control

this should solve the problem

simon
 
to simonchristies
I went to Windows Explorer to the folder. Right clicked on folder. Clicked on properties. There are four tabs: General, Sharing, Web Sharing, Customize. There was no security tab.

I tried to use administative tools, Internet Information Services and right clicked on folder. Clicked properties and allowed anonymous access.

Still get the message. Am I doing the procerure correctly?

Thanks,
Charlix
 
As far as I know, I am the adminitrator.
Charlix
 
How do I give the IUSR account read and write ppermissions?
Charlix
 
there should be a user account on your machine called

IUSR_YourMachineName

this is the 'guest' account that iis uses to access your computer.

 
When I go to Internet Information Services I see three nodes under the computer name: Web Sites; FTP Sites; Default SMTO Virtual Server. I can only raise the Security tab with the Default SMTP Virtual Server Tab. I have given permission to IUSR and guest to no avail.
Thanks,
Charlix
 
What OS are you on? This might help us give you more detailed instruction as to where to find the permissions for the folder, since it seems to slightly change with every version of Windows. For example, i can't seem to find folder security settings in XP Pro that I know like the back of my hand in 2000 server.

-T

01000111 01101111 01110100 00100000 01000011 01101111 01100110 01100110 01100101 01100101 00111111
The never-completed website:
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top