Importing Data from an ODBC source.

By: Ben Matterson

Abstract: How to import data into JDataStore from an ODBC data source using the JBuilder Designer.

How can I import data from an ODBC source to a JDataStore?

You can do it one of three ways
  1. Create a query using DataStore Explorer (Tools | New SQL Query), or
  2. Write some code to do it, or
  3. Through the JBuilder Designer.
To do this via the JBuilder Designer:
  • Drop a Database, a QueryDataSet, a DataStore and a GridControl/JdbTable component on a frame.
  • Set the Database connection to your ODBC source;
  • Set the FileName property of the DataStore;
  • Set The StoreName property in the QDS. This will be the streamName inside the store.
  • Set the Store property of the QDS to the DataStore component.
  • Set the Query property of the QDS.
By the time you test your query, the store will be created. Or if you didn't test it, it will be created by the time you set the DataSet property of the visual control and the data is displayed.

Don't forget that for an ODBC connection, you need first to create an Alias using the ODBC Administrator and have the correct ODBC driver installed.

Server Response from: ETNASC04