Board index » delphi » Access Violation in msado15.dll (D5/ADO/DB2) Sequel

Access Violation in msado15.dll (D5/ADO/DB2) Sequel

On the 08/29/2001 I posted that problem (see my original message here in
after) and did not find a solution at that time.

Today I have a solution. Instead of using a TAdoQuery do it with a
TAdoConnection like this :

Var SqlCmd : String;

Begin
        SqlCmd := 'INSERT INTO MyTable ( Col1, Col2 ...) VALUES (Val1, Val2
...)';
        Try
             Ado_Connect.BeginTrans;
             Ado_Connect.Execute( SqlCmd, cmdText, [eoExecuteNoRecords] );
             Ado_Connect.CommitTrans;
       Except
              Display_ConnectionErrors(Ado_Connect);
              Ado_Connect.RollbackTrans;
              End;
End

Now I still have a question : where is the bug ? In Borland components ? In
MDAC ? In IBM Provider ?

My original message was (on 08/29/2001)
"I am working with Windows 2000 pro, Delphi 5 Last update, ADO Express
update2, MDAC 2.6 sp1 and IBM DB2  V7.1 last update (which is 7.2 in fact as
they say).
When I am trying to insert a new record with an ADO query (INSERT INTO
Table...), it works fine. But when the record already exists, I get the
message "Exception EAccessViolation  in msado15.dll ..." only when I quit
the program (very strange). The code is something like that :

// MyQuery.SQL = INSERT
                                   INTO   AFFAIRE ( NOAFFAIRE,  DCREATION)
                                   VALUES               ( :NoAff ,
:Dcreation)
// NOAFFAIRE is the PK.

With MyQuery Do Begin
        Parameters.ParamByName('NoAff').Value := P1;
        Parameters.ParamByName('Dcreation').Value :=
FormatDateTime('yyyy-mm-dd', Date);
        Try
              {Prepared := True} // With or whithout prepared same problem.
               ExecSQL;    // Exception here
         Except
               Message ...  // This instruction is never reached when trying
to insert a duplicate record
               End;
        End;

Does anybody knows what is wrong with my code ? or perhaps with Microsoft ?

--
Cordialement
Rgis CLUSEAU

r.clus...@datasoft.fr

 

Re:Access Violation in msado15.dll (D5/ADO/DB2) Sequel


Quote
>Now I still have a question : where is the bug ? In Borland components ? In
>MDAC ? In IBM Provider ?

My guess is that its a problem with the IBM provider or maybe they just expect
all executes to be wrapped in a transaction to work properly.  I have never used
DB2.
Anyway if you want to rule out MDAC and AdoExpres just test the problem query on
SQL server if it behaves properly its not a problem in either of these.

--
Brian Bushay (TeamB)
Bbus...@NMPLS.com

Re:Access Violation in msado15.dll (D5/ADO/DB2) Sequel


In fact I tested it on ORACLE 7.3 and it worked perfectly. But was it a
coincidence ?
R.C.

"Brian Bushay TeamB" <BBus...@Nmpls.com> a crit dans le message news:
7tbfptovft7ddkeb4ado3sqd4mt14ju...@4ax.com...

Quote

> >Now I still have a question : where is the bug ? In Borland components ?
In
> >MDAC ? In IBM Provider ?

> My guess is that its a problem with the IBM provider or maybe they just
expect
> all executes to be wrapped in a transaction to work properly.  I have
never used
> DB2.
> Anyway if you want to rule out MDAC and AdoExpres just test the problem
query on
> SQL server if it behaves properly its not a problem in either of these.

> --
> Brian Bushay (TeamB)
> Bbus...@NMPLS.com

Re:Access Violation in msado15.dll (D5/ADO/DB2) Sequel


We are getting the exact same problem running on NT, not on Win98 machines,
using MS Access databases....

Any idea what the problem might be?

It's either MDAC2.6 or the current ADO patch...

Fred

"Brian Bushay TeamB" <BBus...@Nmpls.com> wrote in message
news:7tbfptovft7ddkeb4ado3sqd4mt14jusir@4ax.com...

Quote

> >Now I still have a question : where is the bug ? In Borland components ?
In
> >MDAC ? In IBM Provider ?

> My guess is that its a problem with the IBM provider or maybe they just
expect
> all executes to be wrapped in a transaction to work properly.  I have
never used
> DB2.
> Anyway if you want to rule out MDAC and AdoExpres just test the problem
query on
> SQL server if it behaves properly its not a problem in either of these.

> --
> Brian Bushay (TeamB)
> Bbus...@NMPLS.com

Re:Access Violation in msado15.dll (D5/ADO/DB2) Sequel


Quote
>We are getting the exact same problem running on NT, not on Win98 machines,
>using MS Access databases....

>Any idea what the problem might be?

No.  Can you create an example that will cause this problem using the sample
NorthWind.mdb?

--
Brian Bushay (TeamB)
Bbus...@NMPLS.com

Other Threads