Link to home
Start Free TrialLog in
Avatar of stehlik
stehlik

asked on

distributing ODBC

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.
ASKER CERTIFIED SOLUTION
Avatar of jpk041897
jpk041897

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of stehlik
stehlik

ASKER

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)?

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