荔园在线

荔园之美,在春之萌芽,在夏之绽放,在秋之收获,在冬之沉淀

[回到开始] [上一篇][下一篇]


发信人: Peter (小飞侠), 信区: Program
标  题: C++ Builder常见问题解答(2)
发信站: BBS 荔园晨风站 (Fri Jan 22 13:51:46 1999), 转信


第二部分        BDE

1、BDE Version problems

Question:
I have more than one installation of the Borland Database
Engine and I am having troubles configuring the BDE to work
with either Delphi, C++Builder, or IntraBuilder.

Answer:
Run regedit to see what your current path is for your DLLPATH
under HKEY_LOCAL_MACHINE\software\Borland\Database Engine.
There should be one and only one path for this key.  If
there is more than one, it will result in problems.
Furthermore, the CONFIGFILE01 key should point to your latest
config file.

One way to resolve problems arising from
conflicting installations of the database  engine is to
reinstall the version of Borland's compiler or
tool (either Delphi, Intrabuilder, or C++Builder) that has the
latest version of the BDE. Then edit the DLLPATH in the registry so
that it uses the default that the installation program gave.

This works because the latest version of the BDE is backward
compatible which means that it will run applications written
with previous versions of the BDE.

2、How to delete ODBC drivers

Question:
How do I delete ODBC drivers? Once I remove them with
the IDAPI configuration tool, save, exit and come back
into the configuration utility, its still there.

Answer:
Removing the 'Database Engine' registry entry,
and running the BDE install, fixes the problem.

3、Error 'ODBC is either not installed or corrupt'

Question:
When I try to add a new ODBC driver under my installation
of the BCB 1.0 product I get the error odbc is either
not installed or corrupt. Has my installation failed or
is it missing something?

Answer:
This happens if you try "Install new ODBC driver" from
the BDE without first installing any 32 bit odbc drivers on
your system.

BCB 1.0 does NOT ship with any ODBC drivers. They must be
purchased seperately from MS or Intersolve.

If control panel does NOT have an icon labeled 32-bit ODBC, then
no 32-bit drivers have been installed on the machine.

4、ODBC Data sources in the BDE

Question:
Why does only one Data Source name show up in the BDE
configuration utility when I add a new ODBC driver?  I know I
have more than one Data Source.

Answer:
This is probably the result of a bug.
To work around this, with the 'Default
Data Source Name' combo box selected, use
the arrow keys to select the correct
data source.

5、IDAPI/BDE install errors

Question:
I run the install and get a message saying that the install is
having trouble locating files associated with the bde or idapi.
I click ok and the install finishes. BCB boots up fine but I
get the error " cannot initialize the Borland Database Engine "
or something similar. This occurs when I launch the BDE
configuration utility, database desktop or use BCB's
database capabilities in a project. Why is the install failing?

Answer:
This problem is often caused by InstallShield conflicting with a
drive that is doublespaced using the DoubleSpace disk compression
utility. Solution is to decompress the drive or install to another
drive.

6、Can I use Older SQL links?

Question:
Can I use older versions of SQL Links use those with the IDAPI
that ships with other Borland products?

Answer:
No.

7、dBase Record #'s

Question:
How do you go to a specific record Number in a DBase Table?

Answer:
     void __fastcall gotoRecord(TTable* T, int RecNo)
     {
        DBIResult rslt;
        TResyncMode rm;

        rslt = DbiSetToRecordNo(T->Handle, RecNo);
if (rslt != DBIERR_NONE)
        {
           if (rslt == DBIERR_EOF)
              T->Last();
           if (rslt == DBIERR_BOF)
              T->First();
        }

        T->Resync(rm<<rmExact);
     }

8、Multiple records found but only one expected

Question:
I am getting a DBEngine message when editing a record that says
"Multiple records found but only one expected".  What does this
mean?

Answer:
You may need to create a unique index on the table so that each
row can be uniquely identified.  That *may* first require
altering the table and adding a column to be populated with
unique values.

9、Repairing corrupt Paradox tables

Question:
Is there a BDE API or a DLL available for rebuilding crashed
indexes (like the TUTILITY.EXE shipped with Pdoxwin)?

Answer:
The BDE includes a function to rebuild indexes, called
DbiRegenIndexes().

10、BDE functions and data types

Question:
Where do I find a listing and description of the BDE functions
and data types?

Answer:
BDE.INT in your BCB\DOC\ directory contains a listing of
BDE functions, expected parameters, return values and a brief
description of each.

For any BDE function call include the BDE.HPP Header file.
For more detailed information on the use of the IDAPI functions,
obtain the Database Engine User's guide from Customer Service.

11、Cannot find method to pack database

Question:
I can't find a method to pack a database file at run time.

Answer:
The VCL does not encapsulate all of the BDE functions calls, but
you can call the BDE directly for functions not encapsulated.
Here is a example of calling the BDE DbiPackTable() function.

DBIResult DBIFN DbiPackTable (hDb, hCursor, pszTableName,
                             [pszDriverType], bRegenIdxs);

- hDb is the handle to the database
- hCursor is a handle to the cursror
- pszTableName use the table name from you VCL calls.
- bRegenIdxs is a boolean ti indicate if you want indexes
  regenerated.

Look at BDE.HPP in VCL include directory for more information.


--
※ 来源:.BBS 荔园晨风站 bbs.szu.edu.cn.[FROM: 192.168.1.3]


[回到开始] [上一篇][下一篇]

荔园在线首页 友情链接:深圳大学 深大招生 荔园晨风BBS S-Term软件 网络书店