Re: querying access tables
From: Miha Markic [MVP C#] (miha)
Date: 09/20/04
- Next message: Marina: "Re: How to deal with cascading changes?"
- Previous message: George Merriman: "Re: How to deal with cascading changes?"
- In reply to: Jochen Becker: "querying access tables"
- Next in thread: Jochen Becker: "Re: querying access tables"
- Reply: Jochen Becker: "Re: querying access tables"
- Messages sorted by: [ date ] [ thread ]
Date: Mon, 20 Sep 2004 16:45:12 +0200
Why the heck you use adodb in first place?
What does the error say when run from ado.net?
--
Miha Markic [MVP C#] - RightHand .NET consulting & development
miha at rthand com
www.rthand.com
"Jochen Becker" <f.j.becker@t-online.de> wrote in message
news:cimq18$gvo$06$1@news.t-online.com...
> 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
>
>
>
>
- Next message: Marina: "Re: How to deal with cascading changes?"
- Previous message: George Merriman: "Re: How to deal with cascading changes?"
- In reply to: Jochen Becker: "querying access tables"
- Next in thread: Jochen Becker: "Re: querying access tables"
- Reply: Jochen Becker: "Re: querying access tables"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|