ODBC Connectivity

DbfScript provides a special function for retrieving data from any ODBC data source. You can use the function RunODBC like this:

var #list = data:RunODBC(connectionString, command)

... to retrieve the data, where connectionString is the string used to connect to the database, and command is the command to run (eg. a SQL statement).

An example of a SQL Server connection string is:

Driver={SQL Server};Server=myServerAddress;Database=myDataBase;Uid=myUsername;
 Pwd=myPassword;

When the function runs, it will return a DbfScript list of records. These records won't have any type information, but can be looped through and copied to records in your application.

This can be used with an Access Script to integrate data from external data sources, including Microsoft Access.

To explore this function, you can also try it out using the Admin Tools area. Use a couple of lines of script to run an ODBC query, and then use "log #list" to log the output to the screen. This can help you devise the script for copying the appropriate data back into your system.


Next Topic:
v4.2.0.956 (beta)
Up Since 2/29/2024 12:02:23 AM