|
-
Oct 1st, 2012, 05:46 AM
#1
Thread Starter
Fanatic Member
If error number is 3050 then ignore?
Hi guys on my vb project which connects to my microsoft access database I keep getting an error : 3050: Could not lock file.
Is there away to either ignore the error throughout the entire project or does anyone know how to fix the error?
Thanks,
Jamie.
-
Oct 1st, 2012, 08:31 AM
#2
Re: If error number is 3050 then ignore?
How are you connecting to the database? Do you really need to lock the file?
Normally one would not be locking the file so other people can use it at the same time.
If anyone else is using it then you can not lock it.
-
Oct 2nd, 2012, 06:20 AM
#3
Thread Starter
Fanatic Member
Re: If error number is 3050 then ignore?
Set WS = DBEngine.Workspaces(0)
dbfile = Form1.Text3.Text
pwdstring = "passs"
Set db = DBEngine.OpenDatabase(dbfile, False, False, ";PWD=" & pwdstring)
Set rs = db.OpenRecordset("SELECT * FROM agents")
that's how i am connecting, there are about 10 people that use the database, so not sure why it trys to lock.
-
Oct 2nd, 2012, 09:49 AM
#4
Re: If error number is 3050 then ignore?
Been a long time since I have did anythign with DAO. You really should be using ADO code instead. Even when I did use DAO I rarely used workspaces. Looks like you are not using the workspace there and it looks like the database should be opening in shared mode.
I would recommend using ADO Code instead but if you want to use the outdated DAO methods perhaps this may help http://msdn.microsoft.com/en-us/libr.../ff835343.aspx
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|