VFP OLEDB Drivers How-To

限制:
以6.0而言,似乎一定要用 ado 來開啟
範例:
OConn = CREATEOBJECT(“ADODB.Connection”)
OConn.ConnectionString = “provider=vfpoledb.1;;
data source=.\testdbc.dbc”
OConn.Open
語法:
Provider = VFPOLEDB
Data Source=cPath
Specifies the path to the Visual FoxPro database or folder containing free tables. For example, d:\vfp7\samples\data\testdata.dbc
Mode=cMode
Specifies one of the following: Read, ReadWrite, Share Deny None (default), Share Deny Read, Share Deny Write, Share Exclusive (inclusive of the previous two modes).
可以丟如下指令
The Visual FoxPro OLE DB Provider supports the native Visual FoxPro language syntax for the following commands:
CREATE TABLE – SQL Command
Creates a table having the specified fields.
DELETE – SQL Command
Marks records for deletion.
DROP TABLE Command
Removes a table from the database specified with the data source and deletes it from disk.
INSERT – SQL Command
Appends a record to the end of a table that contains the specified field values.
SELECT – SQL Command
Retrieves data from one or more tables.
UPDATE – SQL Command
Updates records in a table with new values.
The Visual FoxPro Language Reference contains detailed information about the following supported commands:
ALTER TABLE – SQL Command
Programmatically modifies the structure of a table.
CREATE TABLE – SQL Command
Creates a table having the specified fields.
Using Data Definition Language (DDL)
You cannot include DDL in the following places:
In a batch SQL statement that requires a transaction
Following a previously executed statement that required a transaction if not in auto-commit mode and if your application has not yet called SQLTransact.
For example, if you want to create a temporary table, you should create the table before you begin the statement requiring a transaction. If you include the CREATE TABLE statement in a batch SQL statement that requires a transaction, the provider returns an error message.
DELETE – SQL Command
Marks records for deletion.
DELETE TAG Command
Removes a tag or tags from a compound index (.cdx) file.
DROP TABLE Command
Removes a table from the database specified with the data source and deletes it from disk.
INDEX Command
Creates an index file to display and access table records in a logical order.
INSERT – SQL Command
Appends a record to the end of a table that contains the specified field values.
SELECT – SQL Command
Retrieves data from one or more tables.
The Visual FoxPro OLE DB Provider supports the native Visual FoxPro language syntax for this command.
SET ANSI Command
Determines how comparisons between strings of different lengths are made with the = operator in Visual FoxPro SQL commands.
SET BLOCKSIZE Command
Specifies how disk space is allocated for the storage of memo fields.
SET COLLATE Command
Specifies a collation sequence for character fields in subsequent indexing and sorting operations.
SET DELETED Command
Specifies whether records marked for deletion are processed and whether they are available for use in other commands.
SET EXACT Command
Specifies the rules for comparing two strings of different lengths.
SET EXCLUSIVE Command
Specifies whether table files are opened for exclusive or shared use on a network.
SET NULL Command
Determines how null values are supported by the ALTER TABLE – SQL, CREATE TABLE – SQL, and INSERT – SQL commands.
SET PATH Command
Specifies a path for file searches.
Provider Remarks
If you issue SET PATH in a stored procedure, it will be ignored by the following functions and commands: SELECT, INSERT, UPDATE, DELETE, and CREATE TABLE
If you issue SET PATH in a stored procedure and do not subsequently set the path back to its original state, other connections to the database will use the new path (because SET PATH is not scoped to data sessions).
If you want to create, select, or update tables in a directory other than that specified by the data source, specify the full path of the file with your command.
SET REPROCESS Command
Specifies how many times or for how long to lock a file or record after an unsuccessful locking attempt.
SET UNIQUE Command
Specifies whether records with duplicate index key values are maintained in an index file.
UPDATE – SQL Command
Updates records in a table with new values.