如何用ADO打开DBF文件
编号:QA003136
建立日期: 2000年7月10日 最后修改日期:2000年7月10日
所属类别:
hjm:
操作系统:pwin98 mssql
编程工具:vb6.0 vf 6.0
问题:我在用VB 开发程序过程中,要引用VF的数据库,我用如下代码打开,但总是有错误提示:代码如下:On Error Resume Next
conn2.ConnectionString = "Provider=MSDASQL.1;Persist Security Info=False;Extended Properties=""DSN=Visual FoxPro Database;UID=;SourceDB=" & djlj & "\Xddb.dbc;SourceType=DBC;Exclusive=No;BackgroundFetch=Yes;Collate=Machine;Null=Yes;Deleted=Yes;"""
conn2.Open
MsgBox conn2.Errors.Count
If conn2.Errors.Count > 0 Then
Msg = "Error # " & Str(Err.Number) & " was generated by " _
& Err.Source & Chr(13) & Err.Description
MsgBox Msg, , "Error", Err.HelpFile, Err.HelpContext
End If
djlj变量为VF 数据库路径。
回答:
ConnectionString :
Provider=MSDASQL.1;Driver=Microsoft Visual Foxpro Driver;SourceDB=e:\dbfs;SourceType=DBF;
Provider=MSDASQL.1;Driver=Microsoft Visual Foxpro Driver;DBQ=e:\dbfs;SourceType=DBF;
相关问题:
QA000185 "在VB5中,如何打开一个FOXBASE数据库"
此问题由PlayYuer回答。
| |
|
|
| |
|
|