How do I create an ODBC connection to use the ODBC/JDBC Driver?

Top   « Previous  Next »

MobileDataNow comes supplied with the Microsoft Northwind sample database so we can use it for this demo. First we're going to first setup a connection to this database so it's available to be used on your computer, and we provide this connectivity through an ODBC driver.

 

The Data Source Name (or DSN) provides this connectivity to the database through an ODBC driver. The DSN contains the database name, directory, database driver, User ID, password and other information.

 

Once you create a DSN for a particular database, you can use the DSN in MobileDataNow or any other application to call information from the database.

 

There are three types of DSNs:

(1) System DSN -- can be used by anyone who has access to the machine. DSN info is stored in the registry.

(2) User DSN -- created for a specific user. Also stored in the registry.

(3) File DSN -- DSN info is stored in a text file with .DSN extension.

 

We'll be creating a System DSN.

 

The following example illustrates connection to a sample Microsoft Access database called 'northwind.mdb'. We've included the northwind.mdb database for your testing.

 

To run the ODBC Data Source Administrator, click Start, then Run and type odbcad32.exe, then press Enter

 

Alternatively select Start/Settings/Control Panel/Administrative Tools/Data Sources (ODBC)

 

 

Select the System DSN tab then click Add

 

ODBC-System DSN

 

 

Highlight MS Access Driver (*.mdb) – note must be version 4.x or later

 

ODBC-MS Access

 

 

In the Data Source Name field enter a simple name for the database eg. “Northwind” and click on the Select button.

 

ODBC-northwind

 

 

Use the Directories window to highlight the directory containing the database e.g. C:\mdn then in the Database Name window highlight the actual database eg northwind.mdb then click OK and then OK again.

 

The Northwind database included with MobileDataNow is located at C:\Program Files\Mobile Data Now directory

 

ODBC-select northwind

 

 

The System DSN window should now show the new ODBC system data source you created called Northwind.

Click OK.

 

ODBC-System DSN-finished