ADO Connection Puts Network Database In Read Only

Schwimms

New Member
Joined
Jan 31, 2008
Messages
49
Hi All,
I have an excel spreadsheet that is linked into an access database through ADO connections. The spreadsheet is set up to make updates and adds directly into a table in my database. The database is on a server, what is happening is, and I don't know the cause, the database is being put into read only mode and gets stuck in read only. There is no record locking database file that is getting created as well, which is usually what happens when you open a database.
The connections when contacting the database are set to:
Code:
Conn1.Mode = adModeReadWrite
and when it is done with either the update or add the connection is closed:
Code:
Conn1.Close
Conn1.ConnectionString = ""
Does anyone know how I can avoid my database getting locked up? Or is this jsut a server issue that may be causing it? Is there a way to avoid the server from causing this issue?
 

Excel Facts

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.
If a lock file is not created you (or the owner of the file) probably have no write privileges on the directory where the database exists. This must be addressed by the network admins. Access databases must have write privileges since they must create this lock file.
 
Upvote 0
Xenou, would it be a useful test to copy the database to the local hard disk and try it from there?
 
Upvote 0
May be a silly question, but you haven't got the database open have you? I seem to run into read/write issues if I have a db open whilst trying to interact with it from excel..
 
Upvote 0
Xenou, would it be a useful test to copy the database to the local hard disk and try it from there?

I think it would - to be sure that the only "problem" is the location of the file and not anything else in the code.

@slinky:
You can set an access database to open in "shared" mode or in "exclusive" mode. You probably want to be sure the database is "shared" if you are accessing it from Excel while it is also open otherwise. You might want to check your Application settings for access to make sure that the default open mode is "Shared".
 
Upvote 0
So I know what causes the problem. A user will crash their Excel in the middle of refreshing their spreadsheet of the data being pulled from the database. Is there any way to destroy a database connection before a users spreadsheets crashes?
 
Upvote 0

Forum statistics

Threads
1,215,326
Messages
6,124,258
Members
449,149
Latest member
mwdbActuary

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top