数据库连接出错:未处理OleDbException
我是2005的初学者,在书上看到数据库连接的一段代码,但是一执行就报错大家能帮我看看么
Dim ConnString As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=Database1.mdb"
Dim SQLString As String = "SELECT * FROM Part2 WHERE [ID]<>''"
Dim OleDBConn1 As System.Data.OleDb.OleDbConnection = New System.Data.OleDb.OleDbConnection(ConnString)
Dim DataSet1 As New DataSet()
Dim OleDbDataAdapter1 As System.Data.OleDb.OleDbDataAdapter = New System.Data.OleDb.OleDbDataAdapter(SQLString, OleDBConn1)
OleDBConn1.Open()
OleDbDataAdapter1.Fill(DataSet1, "Part2")
DataGridView1.DataSource = DataSet1.Tables("Part2")
每次都是在OleDbDataAdapter1.Fill(DataSet1, "Part2")出错
错误内容是Data type mismatch in criteria expression.未处理OleDbException
谁能帮帮我
谢谢
[此贴子已经被作者于2007-7-1 14:22:44编辑过]