数据库连接字符串 - Visual FoxPro
ODBC DSN
// ODBC DSN
using System.Data.Odbc;
OdbcConnection conn = new OdbcConnection(); conn.ConnectionString = "Dsn=DsnName"; conn.Open(); |
ODBC without DSN -- Database container (dbc)
// ODBC without DSN -- Database container (dbc)
using System.Data.Odbc;
OdbcConnection conn = new OdbcConnection(); conn.ConnectionString = "Driver={Microsoft Visual FoxPro Driver};" + "SourceType=DBC;" + "SourceDB=C:/MyPath/MyDb.dbc;" + "Exclusive=No"; conn.Open(); |
ODBC without DSN -- Free table directory
// ODBC without DSN -- Free table directory
using System.Data.Odbc;
OdbcConnection conn = new OdbcConnection(); conn.ConnectionString = "Driver={Microsoft Visual FoxPro Driver};" + "SourceType=DBF;" + "SourceDB=C:/MyPath;" + "Exclusive=No"; conn.Open(); |
OleDb -- Database container (dbc)
// OleDb -- Database container (dbc) using System.Data.OleDb;
OleDbConnection conn = new OleDbConnection(); conn.ConnectionString = "Driver=VFPOLEDB;" + "Data Source=C:/MyPath/MyDb.dbc;" + "Collating Sequence=machine;" + "Password=Secret;"; conn.Open(); |
OleDb -- Free table directory
// OleDb -- Free table directory using System.Data.OleDb;
OleDbConnection conn = new OleDbConnection(); conn.ConnectionString = "Driver=VFPOLEDB;" + "Data Source=C:/MyPath/;" + "Collating Sequence=general;" + "Password=Secret;"; conn.Open(); |