DOCUMENT:Q165492 21-OCT-2000 [foxpro] TITLE :HOWTO: Use ADO with a Visual Foxpro Database PRODUCT :Microsoft FoxPro PROD/VER:WINDOWS:3.0,3.0b,5.0,5.0a,6.0 OPER/SYS: KEYWORDS:kbinterop kbDatabase kbODBC kbvfp300 kbvfp500 kbvfp600 kbGrpDSFox kbGrpDSMDAC kbDSuppor ====================================================================== ------------------------------------------------------------------------------- The information in this article applies to: - Microsoft Visual FoxPro for Windows, versions 3.0, 3.0b, 5.0, 5.0a, 6.0 ------------------------------------------------------------------------------- This article assumes that you are familiar with Microsoft Internet Information Server (IIS) and with creating Active Server Pages (ASP) applications using the programming tools provided with Microsoft Internet Information Server or Microsoft Visual InterDev. Additionally, it assumes that you are familiar with HTML. For more information on Microsoft Information Server and Active Server Pages please see the following Web site: http://www.microsoft.com/iis/default.asp SUMMARY ======= This article describes how to use ActiveX Data Objects (ADO) on an Active Server Page (ASP) to access data in a Visual FoxPro database. MORE INFORMATION ================ In order to run Active Server Pages, you must have access to a computer running Microsoft Internet Information Server version 3.0. If you currently have IIS 2.0, you can download IIS 3.0 from the following Web site: http://www.microsoft.com/iis/default.asp In order to access a Visual FoxPro database through ADO, you must have the latest Visual FoxPro ODBC driver. To obtain it, go to: http://www.microsoft.com/data/ and download the Microsoft Data Access Components, version 2.1.2.4202.3 (GA) or later. For more information about obtaining this driver, please see the following article in the Microsoft Knowledge Base: Q157767 PATCH: Vfpodbc5.exe Visual FoxPro ODBC Driver Version 5.0 There are three ways to set up ODBC to access your database over the Internet Information Server: 1. Create a System Data Source on the IIS Server computer that points to the database. 2. Create a File Data Source that points to the database. If you create this Active Server Page in a Database Project in Visual InterDev Studio, if you add a connection that uses a file data source, it includes the data source information in the Global.asa file. This can then be distributed with the Active Server Page. 3. When creating the connection object through VBScript, include the connect string when running the Open method (example below). Limitations ----------- Recordsets, or cursors, generated by Visual FoxPro through the Visual FoxPro ODBC Driver must be of type STATIC, or READONLY. The Visual FoxPro ODBC driver does not support the KEYSET, or DYNAMIC cursor types. Example ------- This example does not use a specific data source. The connect string is being specified in the connection object's Open method. If you do wish to create and use a Data source, ensure it is a System Data Source on the Microsoft Internet Information Server computer. Please Remember --------------- Change the SourceDB setting to reflect the Tastrade.dbc on the test system. Ensure the Visual FoxPro ODBC driver version 6.0.8440.01 is installed on the Microsoft Information Server where this Active Server Page is stored. Please see article reference above for availability options of this driver. Contents of the ASP Page ------------------------ <%@ LANGUAGE="VBSCRIPT" %>
<% = RS(i).Name %> | <% Next %>
<% = RS(i) %> | <% Next %>