|
-
Dec 9th, 2005, 12:09 PM
#1
Thread Starter
Frenzied Member
.dbf locked !!
Damm thing!
I want to open a .dbf db and do a SELECT, I am using ADO
It works when no one is using the .dbf, but it wont be the case, so I get this error:
Could not lock table 'tablename'; currently in use by user...
Here's my connection string:
"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & bookManagerPath & ";Extended Properties=DBASE IV;Mode=Read;"
-
Dec 9th, 2005, 12:23 PM
#2
Fanatic Member
Re: .dbf locked !!
Hi
youll have to specify the max connections as in Dbase 4 it defaults to 1..
Ta
Kai
As the information I give is useful in its nature, consider using the RATE POST feature located on the bottom left of this post please..
A few things that make a good Developer a Great One.
Methodical and a thorough approach to research and design inevitably leads to success.
Forward thinking is the key to Flow of control.
Never test in the design environment, always test in real time, you get the REAL results.
CBSE & OOSE are the same animal, they just require different techniques, and thinking.
SEO is a globe of objectives, SE rankings is an end to a means for these objectives, not part of them.
The key to good design is explicit attention to both detail and response.
Think Freely out of the "Box" you're in..... You will soar to better heights.
Kai Hirst - MSCE, MCDBA, MCSD, MCP, MCAP, MSCT
-
Dec 9th, 2005, 12:27 PM
#3
Thread Starter
Frenzied Member
Re: .dbf locked !!
Specify it from VB ?
The thing is my client has a store inventory program that use those DBFs database all the time and I am making a program that is reading that database and updating his online database for e-commerce.
I could always make a copy of it, but the file is like 18MB and it will take an extra 2-3 minutes evertime.
There must be a way to open it without trying to lock it ??
Thanks
-
Dec 9th, 2005, 02:18 PM
#4
Lively Member
Re: .dbf locked !!
Hi, Try This
VB Code:
myConn.ConnectionString = "Provider=MSDASQL.1;Persist Security Info=False;Extended Properties=Driver={Microsoft dBase VFP Driver (*.dbf)};UID=;SourceDB=c:\DATA;SourceType=DBF;Exclusive=No;BackgroundFetch=Yes;Collate=Machine;Null=Yes;Deleted=Yes;"
-
Dec 9th, 2005, 02:25 PM
#5
Thread Starter
Frenzied Member
Re: .dbf locked !!
Hmm, now it tells me that my table does not exist...
How would I do a select ?
I tried:
FROM tablename
FROM tablename.dbf
FROM [tablename#DBF]
All with the same results...
-
Dec 9th, 2005, 02:32 PM
#6
Lively Member
Re: .dbf locked !!
Hi,
In your path for your connection just point to the DBF folder
"SELECT * FROM tablename"
Fishy
-
Dec 9th, 2005, 02:34 PM
#7
Thread Starter
Frenzied Member
-
Dec 9th, 2005, 02:36 PM
#8
Lively Member
Re: .dbf locked !!
Is your connection opening OK?
-
Dec 9th, 2005, 02:37 PM
#9
Thread Starter
Frenzied Member
Re: .dbf locked !!
Oops, I didn't put my path from the code you gave me
It's works if it's not open, but it still does not let me if the database is opened.
Thanks
-
Dec 9th, 2005, 02:43 PM
#10
Lively Member
Re: .dbf locked !!
Hi,
Try connecting with ADODC (shudder) control. If you can then we can look further
-
Dec 9th, 2005, 02:46 PM
#11
Thread Starter
Frenzied Member
Re: .dbf locked !!
Sorry Fishy, not too familiar with ADODC, is it in the components ?
Also, just a note, I tried with DAO and it gave me a different error, "Open exclusively by another user", I guess that is the real issue and I don't think there's anything to do ? I can't even copy the file !!
-
Dec 9th, 2005, 02:50 PM
#12
Lively Member
Re: .dbf locked !!
Hi,
Yes it's looks that way. We use VFP on one of our systems and I can Interrogate the DBF's no problem with VB6 & ADO. Just a note do you have Ms Access?
-
Dec 9th, 2005, 02:52 PM
#13
Thread Starter
Frenzied Member
-
Dec 9th, 2005, 03:02 PM
#14
Lively Member
Re: .dbf locked !!
Try Linking to the DBF table it might be worth a try..
-
Dec 9th, 2005, 03:06 PM
#15
Thread Starter
Frenzied Member
Re: .dbf locked !!
Damm, good thinking, I linked it and opened it but then I close it and open the DBF and went back to Access and open the linked table and I get the same error I get it VB !!
Thanks for you help, I guess there's not much I can do
-
Dec 9th, 2005, 03:08 PM
#16
Lively Member
Re: .dbf locked !!
Pity.. Is there any way you can ask the original developers about taking the locks off?
-
Dec 9th, 2005, 03:11 PM
#17
Thread Starter
Frenzied Member
Re: .dbf locked !!
Hmm, the program is an old dos Book Manager, I don't think that we can ask for a change.
I will have to tell my client to run a backup and run my program on the backup file.
Why the engin is trying to lock the database, it's a DBase way of doing it ?
-
Dec 9th, 2005, 03:14 PM
#18
Lively Member
Re: .dbf locked !!
Tell them they really need an upgrade and a re-write in vb6. lol
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
|