.Net中如何访问DBF数据库文件?在线等待!!
我使用oledb访问dbf数据库
Dim connectString As String
Dim connection As OleDb.OleDbConnection
Dim command As OleDb.OleDbCommand
Dim reader As OleDb.OleDbDataReader
Dim queryString As String
Dim filepath as string = "c:\data"
connectString = "Provider=MSDASQL.1;Persist Security Info=False;Data Source=dBASE Files;Initial Catalog=" & filepath
connection = New OleDb.OleDbConnection(connectString)
command = New OleDb.OleDbCommand()
Try
command.CommandText = "SELECT fphm FROM zyfp_jk WHERE fpdm = '123'"
reader = command.ExecuteReader(CommandBehavior.CloseConnection)
While reader.Read
messagebox.show(reader.GetString(0))
End With
End While
Next
Catch ex As Exception
Throw New ApplicationException(ex.Message)
Finally
reader.Close()
connection.Close()
connection = Nothing
End Try
但是系统提示"The .Net Framework Data Provider for OLEDB (System.Data.OleDb) does not support the Microsoft OLE DB Provider for ODBC Drivers (MSDASQL). Use the .Net Framework Data Provider for ODBC (System.Data.Odbc)."
问题点数:100、回复次数:4Top
1 楼saucer(思归)回复于 2003-11-04 14:47:28 得分 80
don't use MSDASQL. with OleDb, use System.Data.Odbc if you are using 1.1
or use (not sure if it will work or not):
Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\folder;Extended Properties=dBASE IV;User ID=Admin;Password="
also see
http://www.connectionstrings.com/
Top
2 楼2002pine(2002pine(深圳:msn:huangjinsong2002@hotmail.com))回复于 2003-11-04 14:48:11 得分 10
上面说得很清楚了。用System.Data.OdbcTop
3 楼chinchy(糟老头)回复于 2003-11-04 14:53:44 得分 10
try....
"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\yourfolder;Extended Properties=FoxPro 2.6;User ID=Admin;Password="
or
"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\yourfolder;Extended Properties=FoxPro 3.0;User ID=Admin;Password="Top
4 楼Maurice(Maurice)回复于 2003-11-04 14:56:30 得分 0
thxTop
相关问题
- 怎么通过ado或者ado.net访问Foxpro6.0数据库文件(*.dbf)?主要是连接字符窜怎么写?
- 高分!请教如何访问文件数据库?
- 在UNIX下,如何访问access数据库文件?
- 如何编写Html文件访问,读取SQL数据库?
- xml文件实现数据库访问问题
- 无法访问数据库文件?在线等!
- 在VB中使用ado访问DBase数据库(*.dbf文件)时,如何彻底删除表中的记录??我用sql语句怎么就不行呢?
- 急:怎么通过ado或者ado.net访问Foxpro6.0数据库文件(*.dbf)?主要是连接字符窜怎么写?
- 在VC的ADO中如何访问FOXPRO的数据库(.DBF)?
- 请问如何用VB。NET访问DBF数据库?




