详见 http://community.csdn.net/Expert/TopicView3.asp?id=3783229
帮别人做一个小系统就是从一个dbf文件中提取相关的值,然后计算输出
现在用data控件绑定到datagrid后,出现"外部表不是预期的格式"的错误.
并且用Acess2003打开此文件也是相同的错误,请问如何解决?
这个数据库好像是dbase的某个版本,当时具体不知道是那个,如何判断这个dbf文件是由那种数据库创建的?
ado.connectstring的属性为
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, , ,adCmdTextNote: MDAC 2.1 (or greater) requires the Borland Database Engine (BDE) to update dBase DBF files. (Q238431).
帮别人做一个小系统就是从一个dbf文件中提取相关的值,然后计算输出
现在用data控件绑定到datagrid后,出现"外部表不是预期的格式"的错误.
并且用Acess2003打开此文件也是相同的错误,请问如何解决?
这个数据库好像是dbase的某个版本,当时具体不知道是那个,如何判断这个dbf文件是由那种数据库创建的?
ado.connectstring的属性为
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, , ,adCmdTextNote: MDAC 2.1 (or greater) requires the Borland Database Engine (BDE) to update dBase DBF files. (Q238431).
解决方案 »
- 关于VB中字符串函数取不到值?
- VB里做加法运算 有问题,一时忘记怎么做了!!
- MSComm1.InBufferCount的问题~~~
- vba
- 高手请帮我一把!有关画图软件的编写几个问题
- 怎样用VB代码取得显示器(实际上为显卡能设置的)能显示的各种颜色深度和象素范围?
- 如何用VB生产九个服从(0,1)均匀分布而且相加和为1的不重复随机数
- 数据库备份还原函数让大家研究!并且有几个问题希望深资老鸟帮助一下!
- 请问VB如何获得文件的修改日期,谢谢
- 请问如何在VB使程序暂停一秒
- 菜鸟请教:怎么才能写一个软件,可以没有VB环境就可以运行,但是大小只有几K,几十K?我做的在没有VB的环境下根本就不运行,要不就很大
- 请问用WORD模板用来做打印报表时,做好后的软件在没有装办公软件的机子上还能运行吗
Dim cn As New ADODB.Connection
Dim rs As New ADODB.Recordset
Dim cnstr As String
cnstr = "Driver={Microsoft Visual FoxPro Driver};" & _
"SourceType=DBF;" & _
"SourceDB=" & Str & ";" & _
"Exclusive=No"
'MsgBox Str
'MsgBox cnstr
cn.Open cnstr
rs.CursorLocation = adUseClient
rs.Open "select * from gdzc.DBF", cn, adOpenKeyset, adLockBatchOptimistic
Set DataGrid1.DataSource = rs
DataGrid1.Refresh
Dim conn As New ADODB.Connection
conn.ConnectionString = "provider=msdasql;DRIVER=Microsoft Visual FoxPro Driver;UID=;Deleted=yes;Null=no;Collate=Machine;BackgroundFetch=no;Exclusive=No;SourceType=DBF;SourceDB=C:\fox\data;"
conn.Open
这个是怎么回事?