Results 1 to 18 of 18

Thread: .dbf locked !!

  1. #1

    Thread Starter
    Frenzied Member sebs's Avatar
    Join Date
    Sep 2000
    Location
    Aylmer,Qc
    Posts
    1,606

    .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;"

  2. #2
    Fanatic Member kaihirst's Avatar
    Join Date
    Jul 2005
    Location
    The Resaurant At the End of The Universe
    Posts
    633

    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


  3. #3

    Thread Starter
    Frenzied Member sebs's Avatar
    Join Date
    Sep 2000
    Location
    Aylmer,Qc
    Posts
    1,606

    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

  4. #4
    Lively Member
    Join Date
    Apr 2005
    Posts
    91

    Re: .dbf locked !!

    Hi, Try This

    VB Code:
    1. 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;"

  5. #5

    Thread Starter
    Frenzied Member sebs's Avatar
    Join Date
    Sep 2000
    Location
    Aylmer,Qc
    Posts
    1,606

    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...

  6. #6
    Lively Member
    Join Date
    Apr 2005
    Posts
    91

    Re: .dbf locked !!

    Hi,

    In your path for your connection just point to the DBF folder


    "SELECT * FROM tablename"

    Fishy

  7. #7

    Thread Starter
    Frenzied Member sebs's Avatar
    Join Date
    Sep 2000
    Location
    Aylmer,Qc
    Posts
    1,606

    Re: .dbf locked !!

    That's what I have...

  8. #8
    Lively Member
    Join Date
    Apr 2005
    Posts
    91

    Re: .dbf locked !!

    Is your connection opening OK?

  9. #9

    Thread Starter
    Frenzied Member sebs's Avatar
    Join Date
    Sep 2000
    Location
    Aylmer,Qc
    Posts
    1,606

    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

  10. #10
    Lively Member
    Join Date
    Apr 2005
    Posts
    91

    Re: .dbf locked !!

    Hi,
    Try connecting with ADODC (shudder) control. If you can then we can look further

  11. #11

    Thread Starter
    Frenzied Member sebs's Avatar
    Join Date
    Sep 2000
    Location
    Aylmer,Qc
    Posts
    1,606

    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 !!

  12. #12
    Lively Member
    Join Date
    Apr 2005
    Posts
    91

    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?

  13. #13

    Thread Starter
    Frenzied Member sebs's Avatar
    Join Date
    Sep 2000
    Location
    Aylmer,Qc
    Posts
    1,606

    Re: .dbf locked !!

    Yes, I have MS Access...

  14. #14
    Lively Member
    Join Date
    Apr 2005
    Posts
    91

    Re: .dbf locked !!

    Try Linking to the DBF table it might be worth a try..

  15. #15

    Thread Starter
    Frenzied Member sebs's Avatar
    Join Date
    Sep 2000
    Location
    Aylmer,Qc
    Posts
    1,606

    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

  16. #16
    Lively Member
    Join Date
    Apr 2005
    Posts
    91

    Re: .dbf locked !!

    Pity.. Is there any way you can ask the original developers about taking the locks off?

  17. #17

    Thread Starter
    Frenzied Member sebs's Avatar
    Join Date
    Sep 2000
    Location
    Aylmer,Qc
    Posts
    1,606

    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 ?

  18. #18
    Lively Member
    Join Date
    Apr 2005
    Posts
    91

    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
  •  



Click Here to Expand Forum to Full Width