假设数据目录为"C:\temp",数据表名为:ttable
dim conn as new adodb.connection
Dim rs As New ADODB.Recordsetconn = "Provider=MSDASQL.1; " & _
"Persist Security Info=False; " & _
"Driver={Microsoft Visual FoxPro Driver}; " & _
"SourceDB=c:\temp;" & _
"SourceType=DBF;" & _
"Exclusive=No;"cnn.Open connrs.CursorLocation = adUseClient
rs.Open "select * from ttable", cnn, adOpenKeyset, adLockPessimistic
以上是由liujianghong(liujianghong) 给我提供
在此至谢!
dim conn as new adodb.connection
Dim rs As New ADODB.Recordsetconn = "Provider=MSDASQL.1; " & _
"Persist Security Info=False; " & _
"Driver={Microsoft Visual FoxPro Driver}; " & _
"SourceDB=c:\temp;" & _
"SourceType=DBF;" & _
"Exclusive=No;"cnn.Open connrs.CursorLocation = adUseClient
rs.Open "select * from ttable", cnn, adOpenKeyset, adLockPessimistic
以上是由liujianghong(liujianghong) 给我提供
在此至谢!
"Driver=Microsoft Visual FoxPro Driver;" & _
"SourceDB=D:\guopj\监测软件数据分析系统\程序\抄表机数据库;" & _
"SourceType=DBF"
adoConnectDBF.CursorLocation = adUseClient
adoConnectDBF.Open connStr
不过首次运行的时候要设置数据源
oConn.Open "Driver={Microsoft dBASE Driver (*.dbf)};" & _
"DriverID=277;" & _
"Dbq=c:\somepath;"Note: Specify the filename in the SQL statement. For example:
oRs.Open "Select * From user.dbf", oConn, , ,adCmdText
不过,本人想访问局域网上某台服务器上的DBase数据库,不知是否可以动态指定服务器名称和数据库名称??