Microsoft KB Archive/115917

From BetaArchive Wiki

Article ID: 115917

Article Last Modified on 1/26/2005



APPLIES TO

  • Microsoft Access 2.0 Standard Edition



This article was previously published under Q115917

Moderate: Requires basic macro, coding, and interoperability skills.

SUMMARY

Btrieve files have owner names embedded in them. These owner names can be used as passwords, but many applications that use Btrieve use other passwords to control user access.

Owner names are frequently set to read-only access. As a result, you can get the error message "Drive or network error" when you attempt to update the database file. If the owner name allows read-only access, Microsoft Access does not prompt you for a password until you attempt to update the file.

The DDFPassword line in the [Btrieve ISAM] section of the MSACC20.INI file can be used to set the owner name of .DDF files, but cannot be used to set the owner names of other Btrieve files. The owner names of other Btrieve files can be set programmatically when they are attached to Microsoft Access.

Only the user who created the Btrieve files and originally set the owner name can provide the owner name to you. It may be necessary for you to contact the original file creator to obtain the owner name, or have the files' creator provide files that do not have owner names embedded in them.

MORE INFORMATION

Btrieve database files contain only data. They do not contain other database information (unlike Microsoft Access database files, which do contain other information or objects). Each Btrieve file contains only one table. You must use a separate application to access the data contained in a Btrieve database file, and this application must also provide all security control. When attached to a Microsoft Access database, each Btrieve file is considered a separate table.

Applications that use Btrieve files can either use a password to control entry to the application (possibly including multiple levels of user permissions), or use file owner names.

File owner names are both embedded in the database file and hard-coded in the application using that file. Since an application may draw information from numerous Btrieve files, and each file can have a unique owner name, the owner name for each file is generally hard-coded in the application. When the application opens a Btrieve database file, the Btrieve database engine compares the database file's embedded owner name with the owner name sent by the application to determine user permissions.

There is no connection between an application's password and the embedded file owner name. You may have an application password that allows you full file-access permissions. This does not mean that you can directly access the files without the application, since the owner name hard-coded in the application is different than your application password.

Owner names assigned to Btrieve files can have one of four security options:

  • Require an owner name for any access--no data encryption.
  • Permit read-only access without an owner name--no data encryption.
  • Require an owner name for any access--with data encryption.
  • Permit read-only access without an owner name--with data encryption.

If a read-only option is set on the Btrieve database file (with or without an owner name), Microsoft Access can open the file and display its contents. However, if you attempt to update the file, you will receive the error message "Drive or network error."

Microsoft Access Prompts for Password

When you are using any of the installable ISAMs (such as Btrieve, Paradox, or dBASE), if you attempt to open an attached table that is password protected, Microsoft Access will prompt you for a password after the open attempt fails.

In Btrieve, if you set the owner name option to read-only access, the open does not fail and Microsoft Access does not prompt you for a password. No error or warning occurs until you attempt to update the file.

How to Specify an Owner Name

This article assumes that you are familiar with Access Basic and with creating Microsoft Access applications using the programming tools provided with Microsoft Access. For more information on Access Basic, please refer to the "Building Applications" manual.

You can specify an owner name for the .DDF files using the DDFPassword line in the [Btrieve ISAM] section of the MSACC20.INI file. However, this is of little benefit since it only sets the password for the .DDF files, not for the Btrieve database file.

You can use Access Basic to attach the Btrieve database file and specify the owner name so that full read-write permissions are available. After you attach the table, it is not necessary to specify the owner name again.

The following sample Access Basic code demonstrates how to attach a Btrieve file called MYFILE and specify the file owner name as a Microsoft Access password:

   Sub TablePwd ()
      Dim MyDB As Database, MyTD As TableDef
      Set MyDB = DBEngine.Workspaces(0).Databases(0)
      Set MyTD = MyDB.CreateTableDef("MYFILE")
      MyTD.connect = "btrieve;PWD=OwnrNm;Database=C:\MYDIR\FILE.DDF"
      MyTD.sourcetablename = "MYFILE"
      MyDB.tabledefs.Append MyTD
   End Sub
                


Note that this example uses the FILE.DDF file located in the C:\MYDIR directory to search for a Btrieve table named MYFILE, and then attempts to attach the file to the current database using the password "OwnrNm."

The products discussed here are manufactured by vendors independent of Microsoft; we make no warranty, implied or otherwise, regarding these products' performance or reliability.


Additional query words: attaching odbc vbwin

Keywords: kberrmsg kbinfo kb3rdparty KB115917