Board index » delphi » Delphi5/6, ADO/BDE, Client Access and DB2 on AS400 Problem

Delphi5/6, ADO/BDE, Client Access and DB2 on AS400 Problem

Hi,

I have done a search on this group for DB2 and there does not
seem to be many people using DB2 with Delphi... But I'll try my
luck anyway.   So *anybody* with an idea, please help, I've got a problem thats driving me crazy.  

First, the setup:

NT4 SP6
MDAC 2.6
IBM Client V4R5M0
AS400/DB2
Delphi 6 Ent trial (soon to have SP1 installed...)
Also Delphi 5 Pro

The trouble is this:  I've got a query that just refuses to
execute from withing the context of either the Delphi IDE or the
compiled Delphi application.  I've tried various things, e.g.
using the BDE, using ADO, using parameters, not using parameters
etc. etc. When using parameters, either with BDE or with ADO (query components) (both ultimately using the client access ODBC
driver) I get the following error when trying to open the query
(either in the IDE or during app runtime):

[IBM][Client Access Express ODBC Drive (32-bit)][DB2/400 SQL]SQL0518 - Prepared statement QZ.......... not found.

Then I had the thought that perhaps this had something to do with the parameters, so I got rid of them.  Then the error changed to :

[IBM][Client Access Express ODBC Drive (32-bit)][DB2/400 SQL]SQL0518 - Prepared statement STMT0002 not found.

This was all in the context of a rather larger datamodule.  Then I got quite fed up, and created a completely blank application, dropped a single ADODataset on the form, set up the connection string, and set the command text to the query text.  This then produced:

'CommandText does not produce a result set'

Well, then I submitted the query to the server via Client Access
Express's SQL query tool -- it *does* return a result set and
and ran without any problems...  Also I noticed the query took much longer to actually run than the time it took to come back with the 'does not produce a result set' error.

This all just seems rather buggy to me.  The Question is what is at fault.  The oDBC driver?  I'll go have a looksee whether there's a fixpack available for this........

In the meantime, has anybody seen something like this?  Does anybody have any idea what's going on here???

Thanks in advance, any and all comments greatly appreciated.

Walter Prins

 

Re:Delphi5/6, ADO/BDE, Client Access and DB2 on AS400 Problem


Hi,

FWIW I've been to IBM's client access downloads site -- there
are 2 service pack levels available beyond the base V4R5M0
(that I'm using). The current service pack level fixes around
30-40 ODBC related problems alone, some of which sounds like it
may have something to do with my problems.  Will post if it
fixes it.  

Walter

Re:Delphi5/6, ADO/BDE, Client Access and DB2 on AS400 Problem


Hi,

Well the latest service pack for Client Access solved (almost) all of the peculiarties that I've been having (and a few lower priority niggles I've been having.)  So to anyone using Delphi and Client Access to access DB2/400 -- get the service packs or you'll be tearing your hair out!

Regards,

Walter Prins

Re:Delphi5/6, ADO/BDE, Client Access and DB2 on AS400 Problem


Walter,

I don't know exactly what the problwem is although I have sometimes
problems with Client Access. I am using CA Express and use ODBC to
access various tables, and I must say rthere are no problems. We have
a library called SASFIL with various tables in it. What I do is add an
ODBC entry fill in SASFIL the save it as, for example AS400. Then drop
a TQuery or TTable, databasename is AS400, fill in a tablename and it
should work. Whenever I do something more in de ODBC section I get all
kind of errors, and can not EVER use that name again! Sometimes it
creates an error in de IDE and in the program runs fine.... So in
answer to your question, no I haven't got a clue as to what exactly is
going on, but connecting to a DB2 tables should be fairly easy....
Hope this helps

Peter Baars

On 9 Oct 2001 02:52:25 -0700, "Walter Prins"

Quote
<pr...@nospam.ananzi.co.za> wrote:

>Hi,

>I have done a search on this group for DB2 and there does not
>seem to be many people using DB2 with Delphi... But I'll try my
>luck anyway.   So *anybody* with an idea, please help, I've got a problem thats driving me crazy.  

>First, the setup:

>NT4 SP6
>MDAC 2.6
>IBM Client V4R5M0
>AS400/DB2
>Delphi 6 Ent trial (soon to have SP1 installed...)
>Also Delphi 5 Pro

>The trouble is this:  I've got a query that just refuses to
>execute from withing the context of either the Delphi IDE or the
>compiled Delphi application.  I've tried various things, e.g.
>using the BDE, using ADO, using parameters, not using parameters
>etc. etc. When using parameters, either with BDE or with ADO (query components) (both ultimately using the client access ODBC
>driver) I get the following error when trying to open the query
>(either in the IDE or during app runtime):

>[IBM][Client Access Express ODBC Drive (32-bit)][DB2/400 SQL]SQL0518 - Prepared statement QZ.......... not found.

>Then I had the thought that perhaps this had something to do with the parameters, so I got rid of them.  Then the error changed to :

>[IBM][Client Access Express ODBC Drive (32-bit)][DB2/400 SQL]SQL0518 - Prepared statement STMT0002 not found.

>This was all in the context of a rather larger datamodule.  Then I got quite fed up, and created a completely blank application, dropped a single ADODataset on the form, set up the connection string, and set the command text to the query text.  This then produced:

>'CommandText does not produce a result set'

>Well, then I submitted the query to the server via Client Access
>Express's SQL query tool -- it *does* return a result set and
>and ran without any problems...  Also I noticed the query took much longer to actually run than the time it took to come back with the 'does not produce a result set' error.

>This all just seems rather buggy to me.  The Question is what is at fault.  The oDBC driver?  I'll go have a looksee whether there's a fixpack available for this........

>In the meantime, has anybody seen something like this?  Does anybody have any idea what's going on here???

>Thanks in advance, any and all comments greatly appreciated.

>Walter Prins

Other Threads