F
feudalac!
Why isn't this working? (it works in my other program...)
Error is:
Data type mismatch in criteria expression
public DatabasePath As String
Public Function GetDataReader(ByVal AccessQuery As String) As
System.Data.OleDb.OleDbDataReader
Dim AccessConnection As System.Data.OleDb.OleDbConnection
Dim AccessCommand As System.Data.OleDb.OleDbCommand
Dim AccessReader As System.Data.OleDb.OleDbDataReader
Try
AccessConnection = New System.Data.OleDb.OleDbConnection
AccessConnection.ConnectionString =
"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & DatabasePath & ";User
Id=;Password=;"
AccessConnection.Open()
Try
AccessCommand = New System.Data.OleDb.OleDbCommand
AccessCommand.Connection = AccessConnection
AccessCommand.CommandText = AccessQuery
AccessReader = AccessCommand.ExecuteReader()<--Error here
GetDataReader = AccessReader
Catch MyError As System.Data.OleDb.OleDbException
MsgBox(MyError.Message, MsgBoxStyle.Critical, "Error.")
End Try
Catch MyError As System.Data.OleDb.OleDbException
MsgBox(MyError.Message, MsgBoxStyle.Critical, "Error.")
Finally
AccessCommand.Dispose()
End Try
End Function
thanks
--
You're not paid to think. A mindless worker is a happy worker. Shut up
and do your job!
- Tata Feudalac!
Certified Social Engineering Specialist (Because there is no patch for
human stupidity)
Error is:
Data type mismatch in criteria expression
public DatabasePath As String
Public Function GetDataReader(ByVal AccessQuery As String) As
System.Data.OleDb.OleDbDataReader
Dim AccessConnection As System.Data.OleDb.OleDbConnection
Dim AccessCommand As System.Data.OleDb.OleDbCommand
Dim AccessReader As System.Data.OleDb.OleDbDataReader
Try
AccessConnection = New System.Data.OleDb.OleDbConnection
AccessConnection.ConnectionString =
"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & DatabasePath & ";User
Id=;Password=;"
AccessConnection.Open()
Try
AccessCommand = New System.Data.OleDb.OleDbCommand
AccessCommand.Connection = AccessConnection
AccessCommand.CommandText = AccessQuery
AccessReader = AccessCommand.ExecuteReader()<--Error here
GetDataReader = AccessReader
Catch MyError As System.Data.OleDb.OleDbException
MsgBox(MyError.Message, MsgBoxStyle.Critical, "Error.")
End Try
Catch MyError As System.Data.OleDb.OleDbException
MsgBox(MyError.Message, MsgBoxStyle.Critical, "Error.")
Finally
AccessCommand.Dispose()
End Try
End Function
thanks
--
You're not paid to think. A mindless worker is a happy worker. Shut up
and do your job!
- Tata Feudalac!
Certified Social Engineering Specialist (Because there is no patch for
human stupidity)