Use ASP to access various common type database (6)

Source: Internet
Author: User
Tags open dbf file
Iii. List of procedures

' The following programs are written in VBScript

3 DBF file is not a standard database file, only corresponds to a data table in the standard database file, so in order to use DBF file, put all DBF files in a directory, so that the directory name as the standard Data database table, each DBF file corresponds to the standard database data table. In the following function directory is the directory name of DBF,

Function createdbfrecordset (directory name, DBF filename, or SELECT statement)

Dim Conn,driver,sourcetype,dbpath

' Create a Connection object
Set conn = Server.CreateObject ("ADODB. Connection ")
Driver = "Driver={microsoft Visual FoxPro Driver};"
SourceType = "SOURCETYPE=DBF;"
DBPath = "sourcedb=" & Server.MapPath ("Directory Name")

' Invoke the Open method to open the database
Conn. Open Driver & sourcetype & DBPath

Set Createdbfrecordset = Server.CreateObject ("ADODB. Recordset ")
' Open DBF file, parameter two is connection object
Createdbfrecordset.open DBF filename or SELECT statement, Conn, 2, 2

End Function



Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.