Forum Moderators: open

Message Too Old, No Replies

Making an Access DB Connection Readonly

How?

         

ASPhopeful

1:13 pm on Aug 3, 2004 (gmt 0)

10+ Year Member



Hi All,

I have built a site that runs off a number of access databases. The site is split into an admin site (for editing the db's) and the front end (what the use sees). The problem is, I keep coming across messages about the database being opened by another user. I, therefore, need to make the frontend connections read only. How do I do this?

My Sample Connection String
---------------------------
Dim DBcnn
Set DBcnn = Server.CreateObject("ADODB.Connection")
DBcnn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("../../databases/manuals.mdb")

Set ManualSearchRS = Server.CreateObject("ADODB.Recordset")
Set ManualSearchRS.ActiveConnection = DBCnn
ManualSearchRS.Open "SELECT * FROM Manuals WHERE CategoryID = " & GetCats("CategoryID") & " ORDER BY ManualName"

Thanks
ASPhopeful

duckhunter

5:03 pm on Aug 3, 2004 (gmt 0)

10+ Year Member



ManualSearchRS.CursorType = adOpenForwardOnly

(adOpenForwardOnly is in the adovbs file. The value = 0)

Make sure you are closing all recordsets and connections too. Access is very limiting when it comes to multi-user applications like a website.

ASPhopeful

7:54 am on Aug 5, 2004 (gmt 0)

10+ Year Member



Thanks DuckHunter.

I will give that a go and, hopefully, it will fix the problem.

Chris