J
Jochen Becker
Hallo everybody,
the problem goes as follows:
Running a data query to an ACC2000 database from Visual VB or C# using a
WHERE clause is always successful when using DAO, it fails (sometimes) when
using ADODB or ADO.NET. Testing various tables and Queries revealed that the
failure always occurs if the conditions in the WHERE clause contain a
reference to a table field of the combobox type where the data are drawn
from another table.
I have not found any hint to solve this problem( e.g. MSDN kB etc.) and all
my attemps have failed this far.
I have attached at the end one (ADODB) example of many unsuccessful attempts
The error occurs when rec.open(..) is executed.
Using ADO.NET the analogous error occurs when executing
reader = cmd.ExecuteReader()
All the various test codes run fine when no WHERE clause was included or
only fields w/o combo box where addressed in the clause
Who has an idea to overcome this?
Many thnaks for your help in advance
Jochen
-----------------------------------------------
Imports ADODB
Imports System.Data.OleDb
Imports System.Diagnostics
Dim DbSource As String
Dim dbs As New ADODB.Connection
Dim rec As New ADODB.Recordset
Dim dbname, dbadresse, strSQL As String
Dim TimeWindow, CT, LT
Dim FeldWert As Object, FeldWert1 As Object
DbSource = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" &
Replace(dbname, "\", "\\")
strSQL = "SELECT * FROM Preise where preise.Zone='Fern'"
rec.Open(strSQL, dbs, CT, LT, 0)
rec.MoveFirst()
While Not rec.EOF
FeldWert = rec.Fields("zone").Value
MsgBox(FeldWert.ToString)
rec.MoveNext()
End While
rec.Close()
dbs.Close()
------------------------------------------------------
Error message (translated)
A not treated exception of type
'System.Runtime.InteropServices.COMException' occured in AdressenADO.exe.
Additional info: unknown error
the problem goes as follows:
Running a data query to an ACC2000 database from Visual VB or C# using a
WHERE clause is always successful when using DAO, it fails (sometimes) when
using ADODB or ADO.NET. Testing various tables and Queries revealed that the
failure always occurs if the conditions in the WHERE clause contain a
reference to a table field of the combobox type where the data are drawn
from another table.
I have not found any hint to solve this problem( e.g. MSDN kB etc.) and all
my attemps have failed this far.
I have attached at the end one (ADODB) example of many unsuccessful attempts
The error occurs when rec.open(..) is executed.
Using ADO.NET the analogous error occurs when executing
reader = cmd.ExecuteReader()
All the various test codes run fine when no WHERE clause was included or
only fields w/o combo box where addressed in the clause
Who has an idea to overcome this?
Many thnaks for your help in advance
Jochen
-----------------------------------------------
Imports ADODB
Imports System.Data.OleDb
Imports System.Diagnostics
Dim DbSource As String
Dim dbs As New ADODB.Connection
Dim rec As New ADODB.Recordset
Dim dbname, dbadresse, strSQL As String
Dim TimeWindow, CT, LT
Dim FeldWert As Object, FeldWert1 As Object
DbSource = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" &
Replace(dbname, "\", "\\")
strSQL = "SELECT * FROM Preise where preise.Zone='Fern'"
rec.Open(strSQL, dbs, CT, LT, 0)
rec.MoveFirst()
While Not rec.EOF
FeldWert = rec.Fields("zone").Value
MsgBox(FeldWert.ToString)
rec.MoveNext()
End While
rec.Close()
dbs.Close()
------------------------------------------------------
Error message (translated)
A not treated exception of type
'System.Runtime.InteropServices.COMException' occured in AdressenADO.exe.
Additional info: unknown error