Results 1 to 6 of 6
  1. #1
    Join Date
    Oct 2003
    Posts
    3

    Question Unanswered: How to open DBF-file by MS ACCESS in shared mode for writting a data

    Excuse me, could you help me with this file. It is located on a Novel Server using Advantage Database Server. The old Clipper-software is able to open it by many users, but I need to open it in the same time with MS Access 2000 or at least MS Access 97 for writting. I've also tried to open it by Visual Basic in MS ACCESS like a binary file in share mode. But, when I try to write there while it is opened by the Clipper sotware, an error occurs. How it is possible for Clipper to open the file, if it is marked as read only for MS ACCESS? Could you help me, please!
    Attached Files Attached Files

  2. #2
    Join Date
    Aug 2003
    Location
    Belgrade
    Posts
    68

    Re: How to open DBF-file by MS ACCESS in shared mode for writting a data

    Originally posted by ivanm_albena
    I've also tried to open it by Visual Basic in MS ACCESS like a binary file in share mode.
    This is a bit unclear. Are you trying to open a .dbf file from Access using the VBA Open command? (I don't see any other way to open a file in binary share mode.) This doesn't work.

    You should attach your .dbf files to the Access database and then you can use them as any other local table. The problem may be your index format. Access natively supports only the .ndx format (I think), so .ntx and all other Clipper index formats are unusable.

    But your Advanced Database Server could be a good solution. You can connect to it from Access/VB using the ODBC OLE DB provider or a native OLE DB provider for ADS if one is provided.

    I am in a similar situation (Novell server, legacy Clipper applications that need to be ported to Visual Basic .NET) and we are considering ADS as a possible solution. What is your experience with ADS?

  3. #3
    Join Date
    Oct 2003
    Posts
    3

    MORE EXPLANATION

    I am really thankfull to you for the replay. Yes, I use VBA like this:
    Open "K:\HOTELS\LORA\rsv.dbf" For Binary As #1
    and then use GET and PUT commands reading, analising and writing in the sturcture of the DBF. It is a little bit hard but I cannot see other way to write into the file, because of the indexes and because that though I can open the file by MS ACCESS 2000, ACCESS cannot write into the linked DBASE - table. (only could read)

    When the file is not opened by anybody I can write there corretly.

    And also if I copy all the datebase to the local disk of PC with Windows 98 and use that PC like server - connecting to it, in orther to have the required drive K: then I can write into the file by MS ACCESS in the same time while I am openining the file by another PC, connected to that PC. So that I understand that the problem is in using Novel server or ADB server. But I have not experiance with ADB server at all.

    I am glad that meet you having a similar broblem. Have you found any solution with ADB? The ADB we use is version 4.40a. I think it is required 6.00 version for ODBC connection for ACCESS. But we have not possibility to have that varsion now and I am not sure if it will help at all.

    Could you give me some advise please!

  4. #4
    Join Date
    Aug 2003
    Location
    Belgrade
    Posts
    68

    Re: MORE EXPLANATION

    I still don't understand why are you using the low level functions (Open, Put, Write) for updating your .dbf file instead of just attaching the file to Access and the updating it just like any other Access table. Reading data is no problem. If you are using Access 2000 or later, uncheck the option for row level locking and use ADO instead of DAO code for all database operations, and you will not have problems with concurrent data access in a multiuser environment.

    Writing data is a different ball game. Access normaly writes data into attached .dbf files, but you have a serious problem if the same .dbf file is used by live Clipper applications. Access natively supports only the FoxPro index format, but not the original Clipper .ntx format, neither other Clipper index formats. So, if you need to write data into a .mdf file from Access and at the same time you need to maintain indexes whose format Access doesn't support, the only solution I know is to use CodeBase, ADB or a similar product that Access can see as an ODBC or OLE DB source of data.

    As for ADB, I have no practical experience with it. I just downloaded the trial version and played with a couple of basic things just to see what it is all about. But right now I am busy with other things, that is, generating zilion different reports against data in Clipper .dbf files, all done from Access. Thank heavens, Access is able to read .dbf files, otherwise I would be dead by now of writing huge quantities of Clipper code :-))

  5. #5
    Join Date
    Oct 2003
    Posts
    3
    I use low level functions like PUT and GET because when I link the file in MS ACCESS it is not writeable. For reading there is no problem, but I need to edit and to append records. I tried to open it by ADB but unfortunately the error mesage appear which says that the CDX index uses user-defined functions in it, and ADB cannon manage user-defined functions. So the table could not be opened by ADB at all.

    My only opportunity is to handle the table by VBA OPEN command. I don't dare to think that will be able to handle the index because it seems to complicated.

    So I decide to open files one by one in exclusive mode , append the records, and then will recreate the indexes by the Clipper Sofware. It is quite unconvinion but what else could I do?

  6. #6
    Join Date
    Aug 2003
    Location
    Belgrade
    Posts
    68
    Originally posted by ivanm_albena
    I use low level functions like PUT and GET because when I link the file in MS ACCESS it is not writeable.
    The .dbf file is writable directly from Access, but usually not the index file. How did you try to write? Do you use ADO or DAO code? What is the Access version? Send some code.


    For reading there is no problem, but I need to edit and to append records. I tried to open it by ADB but unfortunately the error mesage appear which says that the CDX index uses user-defined functions in it, and ADB cannon manage user-defined functions. So the table could not be opened by ADB at all..
    Well ... that is tough luck. You will probably have to rewrite the application the way it doesn't use user defined functions. But, are they really needed? I may have been lucky so far, but the only external function I ever had to use in my indexes was DESCEND.



    My only opportunity is to handle the table by VBA OPEN command. I don't dare to think that will be able to handle the index because it seems to complicated.
    And you would be right. You can always open any file in binary mode, but what good it is? Also, the OPEN command can handle only one file at a time, so you can't open both the .dbf and the index file in the same command. Don't even think about updating index files through some low level command like WRITE.



    So I decide to open files one by one in exclusive mode , append the records, and then will recreate the indexes by the Clipper Sofware. It is quite unconvinion but what else could I do?
    If you use UDFs in your indexes, looks like your only option is to update your indexes separately from the .dbf file.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •