15. september 2000 - 15:30
#1
Connecting to ODBC Databases
Formula One 3.0 no longer relies on the Visual Basic data control for database connectivity. You can now connect a Formula One workbook to a database using ODBC drivers. This provides greater flexibility in database connection, particularly for developers using environments other than Visual Basic. With this new ODBC connection, you can retrieve data with an ODBC query and use it to populate your Formula One workbook at the starting row and column position you specify.
Installing the ODBC Drivers
In order to connect a Formula One workbook to a database via ODBC, you must have the 32 bit version of the ODBC drivers installed on your system. These drivers come with most 32 bit development environments such as Visual Basic 4.0, Visual FoxPro, Office95, and Visual C++ 2.x. When you install these environments, be sure to select the ODBC option. If you have already installed your development environment, you can re-install and check only the ODBC option. Be aware that different environments offer different quantities and types of drivers. Please contact your development environment vender for information about the drivers available.
Configuring the ODBC Drivers
Once the drivers are installed on your system, they must be configured as follows:
1. Double-click the ODBC icon in the Control Panel to bring up the Data Sources dialog box. If this icon was not created during installation, you can look for the ODBC Admin program (eg ODBCAD32.EXE in VB and MSVC) or consult you documentation for setting up ODBC data sources and drivers.
2. Press the Add button to add a connection to the database you want to reach.
3. In the Add Data Source dialog box, choose the appropriate 32 bit driver for the database you are connecting to and press OK. This brings up an ODBC dialog box based on the driver you chose.
4. Enter a Data Source Name and Database Name that describe the database you want to connect to and press OK. Fill in the advanced options as desired.
5. Note that by selecting the appropriate options in Formula One, you can configure a new data source at runtime in you project.
Connecting with Formula One
The final step is to connect the Formula One workbook to the database. This is done with the Formula One methods ODBCConnect, ODBCQuery, and ODBCDisconnect.
F1Book1.ODBCConnect pConnect, bShowErros, pRetCode
F1Book1.ODBCQuery pQuery, nRow, nCol, bForceShowDlg, pSetColNames, pSetColFormats, pSetColWidths, pSetMaxRC, pRetCode
F1Book1.ODBCDisconnect
The parameters shown in bold must be variables (ie passed by reference). This allows you to retrieve the options selected by the user if they configure a new data source or modify an existing one. See the Formula One OCX help file for more information on these methods.
15. september 2000 - 18:11
#3
Formula One, er det ikke noget bestemt software jeg skal bruge ? hvis ja, hvor kan jeg få det ?