Solved

distributing ODBC

Posted on 1998-01-07
3
840 Views
Last Modified: 2008-02-01
I'd need to know how to install & setup ODBC drivers, MS Jet and related files onto a machine running W95 or WNT. I still can't believe I will have to write a separate application for copying a number of DLL and other files and calling functions like ConfigDriver, ConfigDSN or even SQLWritePrivateProfileString(). There must be an easier way, I hope... And if not, an example of such installation program (source in MS VC++) would help a lot.
0
Comment
Question by:stehlik
  • 2
3 Comments
 
LVL 6

Accepted Solution

by:
jpk041897 earned 100 total points
ID: 1025871
Generaly speaking, you will have to copy the DLL's, but there are alternatives to writting all that code.

The requirenments for each ODBC driver varry, from driver to driver and from vendor to vendor. But, you can almost always get away with copying some files, registering a few and only writting a small program to set some registry values. (This last, is the reason why it is recomended to create your ODBC sources dynamicaly at runtime rather than staticly).

As an aleternative to the registry values, you can also distribute the files needed by ODBC to configure itself, the having the users manual describe the process (Not the best prposition).

Finaly, you can use products such as Install Shield (Profetional Edition, not light) which routines to configure the ODBC sources.

For instance, according to Crystal Reports, for Access 7 you need:

FILE      LOCATION      DESCRIPTION
MSJT3032.DLL      \WINDOWS\SYSTEM or \WINDOWS\SYSTEM32 (NT only)      Microsoft Jet Engine Library
MSJT3032.DLL      \WINDOWS\SYSTEM or \WINDOWS\SYSTEM32 (NT only)      ODBC Desktop driver DLL
MSJTER32.DLL      \WINDOWS\SYSTEM or \WINDOWS\SYSTEM32 (NT only)      Microsoft Jet Database Engine Error DLL
MSJINT32.DLL      \WINDOWS\SYSTEM or \WINDOWS\SYSTEM32 (NT only)      Microsoft Jet Database Engine International DLL
MSVCRT20.DLL      \WINDOWS\SYSTEM or \WINDOWS\SYSTEM32 (NT only)      Microsoft ® C Runtime Library
ODBCCP32.DLL      \WINDOWS\SYSTEM or \WINDOWS\SYSTEM32 (NT only)      Microsoft ODBC Installer
ODBCJT32.DLL      \WINDOWS\SYSTEM or \WINDOWS\SYSTEM32 (NT only)      ODBC driver for Microsoft Access
VBAJET32.DLL      \WINDOWS\SYSTEM or \WINDOWS\SYSTEM32 (NT only)      Visual Basic for Applications Development Environment  Expression Service Loader
VBAR232.DLL      \WINDOWS\SYSTEM or \WINDOWS\SYSTEM32 (NT only)      Visual Basic for Applications Development Environment
VEN2232.OLB      \WINDOWS\SYSTEM or \WINDOWS\SYSTEM32 (NT only)      Visual Basic for Applications Object Library
To configure the datasource properly for Access 7.0, the following files must be registered:
DAO3032.DLL
MSRD2X32.DLL


For Oracle:

ODBC  Oracle

Include the following files if your application will be reporting on Oracle databases:

16bit

FILE      LOCATION      DESCRIPTION
CRBAS07.DLL      \WINDOWS\SYSTEM      INTERSOLV ODBC driver shared library
CRFLT07.DLL      \WINDOWS\SYSTEM      INTERSOLV flatfile ODBC driver shared library
CRUTL07.DLL      \WINDOWS\SYSTEM      INTERSOLV ODBC driver utility DLL
CRORA07.DLL      \WINDOWS\SYSTEM      INTERSOLV ODBC Oracle 6 driver
CROR707.DLL      \WINDOWS\SYSTEM      INTERSOLV ODBC Oracle 7 driver
QECR.LIC      \WINDOWS\SYSTEM      INTERSOLV ODBC driver license file
ORA6WIN.DLL      \WINDOWS\SYSTEM      Oracle version 6.x clientside API
ORA71WIN.DLL      \WINDOWS\SYSTEM      Oracle version 7.x clientside API
32bit

FILE      LOCATION      DESCRIPTION
CRBAS09.DLL      \WINDOWS\SYSTEM or \WINDOWS\SYSTEM32 (NT only)      INTERSOLV ODBC driver shared library
CRFLT09.DLL      \WINDOWS\SYSTEM or \WINDOWS\SYSTEM32 (NT only)      INTERSOLV flatfile ODBC driver shared library
CRUTL09.DLL      \WINDOWS\SYSTEM or \WINDOWS\SYSTEM32 (NT only)      INTERSOLV ODBC driver utility DLL
CROR709.DLL      \WINDOWS\SYSTEM or \WINDOWS\SYSTEM32 (NT only)      INTERSOLV ODBC Oracle 7 only driver
OCIW32.DLL      \WINDOWS\SYSTEM or \WINDOWS\SYSTEM32 (NT only)      Oracle Call Interface (OCI) for Windows
QECR.LIC      \WINDOWS\SYSTEM or \WINDOWS\SYSTEM32 (NT only)      INTERSOLV ODBC driver license file


If you could post what DB you are using (and you don't have Crystal Reports) let me know in a comment and I'll send you the appropiate info.

If you do have crystal, take a look at the runtime file requirenments help file.

Hope this helps.
0
 

Author Comment

by:stehlik
ID: 1025872
OK, thanks for the info about Oracle and Access. Hopefully I need to use the Text (and later also Excel) driver only. Anyway, what to do with the list of files needed to distribute? Just copy all files to %system% directory of Windows?

BTW, I don't have the InstallShield, I got Setup Factory 4.0 instead (a similar software, but much less comfortable - no options for ODBC setup). And I don't want to let user install the ODBC from a Microsoft DataAccessPack or whatever - I will be dealing with totally unexperienced computer users. The installation has to be as much automatical as possible.

As for data source, I think I am configuring it at runtime, have a look:

#if 0
      // find out how to force Excel driver to read all values as SQL_VARCHAR, then the following code will work
/*
      SQLConfigDataSource(NULL,ODBC_ADD_DSN,(LPSTR) "Excel Files (*.xls)",
            (LPSTR) "DSN=New Excel Data Source\0"
            "Description=New Excel Data Source\0"
            "FileType=Excel\0"
            "DataDirectory=C:\\PRICELST\0"
            "MaxScanRows=16\0");
*/
      if (! p_db->OpenEx("DSN=Excel;DBQ="PATH_TO_DATA"\\drextabl.xls;",CDatabase::noOdbcDialog))
#else
      if (! p_db->OpenEx("DSN=Text files;DBQ="PATH_TO_DATA";", CDatabase::noOdbcDialog))
#endif

So I think I only need to install the ODBC drivers and MS Jet into the Windows system, including the Registry update. But how to do it most easily (from within the Setup Factory)?

0
 
LVL 6

Expert Comment

by:jpk041897
ID: 1025873
Your program looks good. As a comment though, I generaly prefer to write the DSN code and OLE registration dirrectly into my app rather than on the installation software. That way, if the instalation were to fail for some reason (as they have a habit of doing) after the files have been copied but before OLE and DSN registration, The program can cath the error and take corrective action.

I am not familiar with Setup Factory (I have been using Install Shield since V.1,0) but if it is in any way similar to other instalation software I have evaluated over time, then it will allow you to make a call to a DLL. If thats the case, in answer to your question, I would suggest you place your code into a DLL and call it inmediatley after you have copied the ODBC files.

Regarding what to do with the files, yes you copy them where appropiate (in almost all cases thats the %system% directory.

The paste of the files I sent you didn't format very well so its not inmediatley visible that the list contains the directory you must install the file to.

As an answer to your final question, the best procedure to install the ODBC files is to make the ODBC instalation a configurable option (if setup factory allows it) so that the user is allowed to reintall ODBC without having to reinstall the entire app and/or overwrite his DB, if that is not possible with your setup program, then provide the user with multiple setup programs (in difrent directories) that allow him to set up full product, DB, program files and ODBC.

The process is actualy quite simple (if cumbersome), first copy all files to the appropiate directory, next (if possible) verify the files copied correctly via a checksum or CRC (I also prefer to do this during application startup to aid in checking for viruses). Finaly, register whatecer is needed in OLE.

As a final note, here are the data files fot Text and Excel:

ODBC  ASCII Text
16bit

FILE      LOCATION      DESCRIPTION
CRBAS07.DLL      \WINDOWS\SYSTEM or \WINDOWS\SYSTEM32 (NT only)      INTERSOLV ODBC driver shared library
CRFLT07.DLL      \WINDOWS\SYSTEM or \WINDOWS\SYSTEM32 (NT only)      INTERSOLV flatfile ODBC driver shared library
CRUTL07.DLL      \WINDOWS\SYSTEM or \WINDOWS\SYSTEM32 (NT only)      INTERSOLV ODBC driver utility DLL
CRTXT07.DLL      \WINDOWS\SYSTEM or \WINDOWS\SYSTEM32 (NT only)      INTERSOLV ODBC Text driver
QECR.LIC      \WINDOWS\SYSTEM or \WINDOWS\SYSTEM32 (NT only)      INTERSOLV license file
32bit

FILE      LOCATION      DESCRIPTION
MSJT3032.DLL      \WINDOWS\SYSTEM or \WINDOWS\SYSTEM32 (NT only)      Microsoft Jet Engine Library
MSJT3032.DLL      \WINDOWS\SYSTEM or \WINDOWS\SYSTEM32 (NT only)      ODBC Desktop driver DLL
ODBCJI32.DLL      \WINDOWS\SYSTEM or \WINDOWS\SYSTEM32 (NT only)      Microsoft ODBC Desktop Driver Pack 3.0
MSJTER32.DLL      \WINDOWS\SYSTEM or \WINDOWS\SYSTEM32 (NT only)      Microsoft Jet Database Engine Error DLL
MSJINT32.DLL      \WINDOWS\SYSTEM or \WINDOWS\SYSTEM32 (NT only)      Microsoft Jet Database Engine International DLL
MSJINT32.DLL      \WINDOWS\SYSTEM or \WINDOWS\SYSTEM32 (NT only)      ODBC Error DLL
MSTX3032.DLL      \WINDOWS\SYSTEM or \WINDOWS\SYSTEM32 (NT only)      Microsoft Jet Text Isam
MSVCRT20.DLL      \WINDOWS\SYSTEM or \WINDOWS\SYSTEM32 (NT only)      Microsoft ® C Runtime Library
ODBCJT32.DLL      \WINDOWS\SYSTEM or \WINDOWS\SYSTEM32 (NT only)      ODBC driver for Microsoft Access
ODTEXT32.DLL      \WINDOWS\SYSTEM or \WINDOWS\SYSTEM32 (NT only)      ODBC (3.0) driver for text files
VBAJET32.DLL      \WINDOWS\SYSTEM or \WINDOWS\SYSTEM32 (NT only)      Visual Basic for Applications Development Environment  Expression Service Loader
VBAR232.DLL      \WINDOWS\SYSTEM or \WINDOWS\SYSTEM32 (NT only)      Visual Basic for Applications Development Environment
VEN2232.OLB      \WINDOWS\SYSTEM or \WINDOWS\SYSTEM32 (NT only)      Visual Basic for Applications Object Library
To configure the datasource properly for ASCII Text, the following files must be registered:
DAO3032.DLL
MSTX3032.DLL


Hope this helps.


ODBC  Excel

Include the following files if your application will be pointing to an Excel (.xls) file:

NOTE:  Be sure to check the requirements for the specific ODBC you are using.

16bit

FILE      LOCATION      DESCRIPTION
CRXLS07.DLL      \WINDOWS\SYSTEM      For Excel 4.0 and earlier
CRXLS507.DLL      \WINDOWS\SYSTEM      For Excel 5.0
CRBAS07.DLL      \WINDOWS\SYSTEM      INTERSOLV ODBC driver shared library
CRFLT07.DLL      \WINDOWS\SYSTEM      INTERSOLV flatfile ODBC driver shared library
CRUTL07.DLL      \WINDOWS\SYSTEM      INTERSOLV ODBC driver utility DLL
QECR.LIC      \WINDOWS\SYSTEM      INTERSOLV ODBC driver license file
32bit

FILE      LOCATION      DESCRIPTION
ODEXL32.DLL      \WINDOWS\SYSTEM or \WINDOWS\SYSTEM32 (NT only)      ODBC (3.0) driver for Excel
MSJT3032.DLL      \WINDOWS\SYSTEM or \WINDOWS\SYSTEM32 (NT only)      Microsoft Jet Engine Library
MSJTER32.DLL      \WINDOWS\SYSTEM or \WINDOWS\SYSTEM32 (NT only)      Microsoft Jet Database Engine Error DLL
MSJINT32.DLL      \WINDOWS\SYSTEM or \WINDOWS\SYSTEM32 (NT only)      Microsoft Jet Database Engine International DLL
MSXL3032.DLL      \WINDOWS\SYSTEM or \WINDOWS\SYSTEM32 (NT only)      Microsoft Jet Excel Isam
MSVCRT20.DLL      \WINDOWS\SYSTEM or \WINDOWS\SYSTEM32 (NT only)      Microsoft ® C Runtime Library
ODBCJI32.DLL      WINDOWS\SYSTEM or WINDOWS\SYSTEM32 (NT only)      Microsoft ODBC Desktop Driver Pack 3.0
ODBCTL32.DLL      WINDOWS\SYSTEM or WINDOWS\SYSTEM32 (NT only)      ODBC Helper Function DLL
ODBCCP32.DLL      WINDOWS\SYSTEM or WINDOWS\SYSTEM32 (NT only)      Microsoft ODBC Installer
ODBCJT32.DLL      \WINDOWS\SYSTEM or \WINDOWS\SYSTEM32 (NT only)      ODBC driver for Microsoft Access
VBAJET32.DLL      \WINDOWS\SYSTEM or \WINDOWS\SYSTEM32 (NT only)      Visual Basic for Applications Development Environment  Expression Service Loader
VBAR232.DLL      \WINDOWS\SYSTEM or \WINDOWS\SYSTEM32 (NT only)      Visual Basic for Applications Development Environment
VEN2232.OLB      \WINDOWS\SYSTEM or \WINDOWS\SYSTEM32 (NT only)      Visual Basic for Applications Object Library
To configure the datasource properly for Excel, the following files must be registered:
DAO3032.DLL
MSXL3032.DLL


0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Entering a date in Microsoft Access can be tricky. A typo can cause month and day to be shuffled, entering the day only causes an error, as does entering, say, day 31 in June. This article shows how an inputmask supported by code can help the user a…
This article explains all about SQL Server Piecemeal Restore with examples in step by step manner.
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now