Creating an ODBC Data Source

Use the following instructions to connect Gsharp to your Microsoft Access database, mydata.mdb

  1. From the Control Panel - select ODBC Data Sources. The ODBC Data Source Administrator should appear
  2. Make sure that User DSN is selected. Click on the Add ... button.
  3. Select the appropriate driver - in this case Microsoft Access Driver (*.mdb) and then click on Finish
  4. Give the data source a name e.g. mydata
  5. Click on Select ... and then enter the appropriate filename.
  6. Click on OK.

You have now set up the ODBC data source. To connect to the mydata source use something like:

echo("connect to Database");
exec sql connect 'admin/@mydata';
exec sql select amount into :y from master;
  • The above script connects to the ODBC source mydata using the account admin.
  • The amount field of the table master is read into the Gsharp dataset y.