810.TXT
=====================================================================
Unraveling the OBDC Mystery
=====================================================================
PRODUCT: R:BASE VERSION: 5.1 or higher
=====================================================================
CATALOG: General Information AREA : Data Manipulation
=====================================================================
ODBC, Open DataBase Connectivity, is a tool used by applications to
access the data stored within a database. You can think of ODBC as a
translator_it translates the data from one database program into a
standard language that can be understood by the requesting
application. In the R:BASE world, ODBC allows both Crystal Reports for
R:BASE and R:BASE for Windows 5.1 to understand and manipulate data
from other database systems or servers.
The players of this translation game are: 1) the data driver, 2) the
data source, 3) the INI files, which store the information about the
driver and source, and 4) the ODBC administrator program. The most
common problems with ODBC is that all the players don't have the
correct information about the game.
The data driver, a Dynamic Link Library (DLL), is the tool ODBC uses
to translate the data from a server to the standard language. Each
server must have an appropriate driver to tell ODBC how to translate.
Information about data drivers is stored in the ODBCINST.INI file.
This file contains two sections. The first section shows which drivers
are installed, for example, RB51_16=Installed. The second section
names the driver, for example, [RB51_16], and gives the path of the
driver file, Driver=C:\WINDOWS\SYSTEM\RB51_16.DLL, and any other
information necessary for the driver. R:BASE requires the setup line
to reference the location of the RBSETUP.DLL file,
Setup=C:\WINDOWS\SYSTEM\RBSETUP.DLL.
;--------------------------------------------------------------------
; WARNING: Do not make changes to this file without using either the
; ODBC Setup program, the ODBC Administrator, or other
; utilities provided for maintaining installed drivers and
; data sources
;
; Changing these files directly could result in a loss of
; information required by ODBC to execute.
;---------------------------------------------------------------------
[ODBC Drivers]
RB51_16=Installed
[RB51_16]
Driver=C:\WINDOWS\SYSTEM\RB51_16.DLL
Setup=C:\WINDOWS\SYSTEM\RBSETUP.DLL
A data source is the server and its location. The information about
data sources is stored in the ODBC.INI file. This file also contains
two sections. The first section shows the data source (database) and
its associated driver, for example, C:\RBWIN\SAMPLE=RB51_16. The data
source name is its location. The location of a data source includes
the drive and directory location of the database files as well as the
database name. The second section specifies the name of the database,
[C:\RBWIN\SAMPLE], and the location of the associated driver,
Driver=C:\WINDOWS\SYSTEM\RB51_16.DLL. A description of the database is
optional for R:BASE.
;--------------------------------------------------------------------
; WARNING: Do not make changes to this file without using either the
; ODBC Setup program, the ODBC Administrator, or other
; utilities provided for maintaining installed drivers and
; data sources.
;
; Changing these files directly could result in a loss of
; information required by ODBC to execute.
;--------------------------------------------------------------------
[ODBC Data Sources]
C:\RBWIN\SAMPLE=RB51_16
[C:\RBWIN\SAMPLE]
Driver=C:\WINDOWS\SYSTEM\RB51_16.DLL
Description=
The name of the driver does not have to match the name of the actual
driver file as it does in this example. The name you put in brackets
for the driver in the ODBCINST.INI file, however, has to be the same
name referenced in the ODBC.INI file in the ODBC Drivers section and
in the ODBC Data Sources sections.
The ODBC administrator program coordinates the information about the
data sources and the associated data drivers. It is a Windows program
used to update the ODBC INI file. The administrator allows the user to
link the appropriate driver with the database and stores the
information in the ODBC.INI file. The administrator does not verify
that a driver is in the location you've specified or that the database
resides in the location you designate during setup. The driver and
database locations are checked when an actual link is attempted, for
example, when R:BASE 5.1 tries to connect to another database or when
Crystal Reports tries to log on to a database to create a new report.
Following are two typical scenarios and the ODBC error messages you
might encounter if the players are not correct.
Situation 1:
I have a database named SAMPLE in my C:\RBWIN directory. The database
was recently upgraded to R:BASE 5.1 from 4.5++. In Crystal Reports, I
try running an existing report based on this database and I get an
error message.
ODBC error: [Microsoft][ODBC DLL] Specified driver could not be loaded
What's wrong? I ran this report last week and everything was fine.
The solution:
The ODBC.INI file still has the driver named R:BASE45 specified for
this database. The ODBC.INI file reads as follows:
[ODBC Data Sources]
C:\RBWIN\SAMPLE=R:BASE45
[C:\RBWIN\SAMPLE]
Driver=C:\WINDOWS\SYSTEM\RBASE45.DLL
The ODBC.INI file needs to be corrected to read:
[ODBC Data Sources]
C:\RBWIN\SAMPLE=RB51_16
[c:\RBWIN\SAMPLE]
Driver=c:\WINDOWS\SYSTEM\RB51_16.DLL
Description=
To correct this problem:
1.Start the ODBC administrator program.
2.From the "Data Sources" dialog box, select the data source reference
for the C:\RBWIN\SAMPLE database and click the Delete button.
3.Click the Yes button to the question "Are you sure you want to
remove the C:\RBWIN\SAMPLE data source?"
4.From the "Data Sources" dialog box, click the Add button.
5.From the "Add Data Source" dialog box select the RB51_16 driver, and
click the OK button.
6.The "Microrim R:BASE Driver Setup" dialog box opens. In the
"Database Name" dialog box, enter the database name C:\RBWIN\SAMPLE
and click the OK button.
7.The database C:\RBWIN\SAMPLE now references the RB51_16 driver.
Close the "Data Sources" dialog box.
Situation 2:
I was using the ODBC connectivity in R:BASE 5.1 to connect to a
database named CONCOMP on the network server. The network
administrator added a new server and now, when I try connecting to
this database in R:BASE 5.1, I get the following error message:
ODBC error: [Microsoft][ODBC DLL] - ERROR- Illegal database name
Why can't I connect to this database any more? It used to work just
fine.
The solution:
When the network administrator added the new server, the drive letters
for the network drives changed. The CONCOMP database is no longer
located on drive G:, it is now on drive H: ODBC can't find the data
source in the location specified by the ODBC.INI file. To correct this
problem, follow the steps outlined above to delete the data source and
reenter it using the new path.