我想通过ado打开(ArcGIS中的).dbf文件,可总是出错:
主要代码如下:
Set adoConn = New ADODB.Connection
Set rsAttribute = New ADODB.Recordset ' 调用Open 方法打开数据库
Dim strPath, strSQL
strPath = "C:\arcgis\arcexe82\ArcObjects Developer Kit\samples\Data\Greeley"
strSQL = "poles.dbf"
adoConn.open "Driver={Microsoft Visual FoxPro Driver};" & _
"SourceType=DBF;" & _
"SourceDB=" & strPath & _
"Exclusive=No;"
rsAttribute.open strSQL, adoConn, 2, 2每次运行到最后一步时,会出这样的错:
Run-time error '-2147217887(80040e21)':
ODBC driver does not support the requested properties.
请问,这个问题如何解决?
谢谢!
主要代码如下:
Set adoConn = New ADODB.Connection
Set rsAttribute = New ADODB.Recordset ' 调用Open 方法打开数据库
Dim strPath, strSQL
strPath = "C:\arcgis\arcexe82\ArcObjects Developer Kit\samples\Data\Greeley"
strSQL = "poles.dbf"
adoConn.open "Driver={Microsoft Visual FoxPro Driver};" & _
"SourceType=DBF;" & _
"SourceDB=" & strPath & _
"Exclusive=No;"
rsAttribute.open strSQL, adoConn, 2, 2每次运行到最后一步时,会出这样的错:
Run-time error '-2147217887(80040e21)':
ODBC driver does not support the requested properties.
请问,这个问题如何解决?
谢谢!
解决方案 »
- 求API的光栅运算函数
- 关于VB下编写activex时param参数传递的问题
- vb编写Active X问题
- Ado的Recordset保存文件,然后用另一个库的Recordset读出这个文件,但是EditMode为零我无法在此库更新该如何是好?
- installshield 打包做成的安装程序的安装过程中的序列号如何设置?!!!!!!在线等待
- 一个关于远程数据库的问题???诚心请教。
- 有哪个高手会写病毒程序??
- 高分征集(数据库问题)
- VB : 符号的代码?
- 如何设置winsock控件的缓冲区的大小
- 关于数据控件加载
- MSFLEXGRID中怎么计算选中某一列或这一列的一部分,就能将这部分的和计算出来啊?在线等啊!
Dim DBpath As StringDBpath = "D:\资料\VB资料\dbfTomdb"
Set Conn = New ADODB.Connection
Conn.Open "Driver={Microsoft FoxPro VFP Driver (*.dbf)};UID=;PWD=;SourceDB=" & DBpath & ";SourceType=DBF;Exclusive=No;"sql = "select * from A.DBF"
Set Rs = New RecordsetRs.Open sql, Conn, adOpenDynamic, adLockOptimistic
用这个吧!!!
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;"
conn.Open
不过我不清楚arcgis是什么?