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

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

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)


Rgis,

Did you run the Microsoft ComCheck program? This program checks for
incompatibilities related to database stuff like ADO, ODBC, etc...
Hope this helps,
--
Prolix Webmaster
http://www.prolix.be
The best newsgroup archive available

Quote
"Regis" <r.clus...@datasoft.fr> wrote in message news:3b8cfd29$1_2@dnews...
> 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)


Unfortunately I made it. It's OK and I still have the problem.
In fact I made a new project with only a form, a button and that AdoQuery.
The result is a bit different.
When I first try to insert an already existing record, it works. But when I
try a second time, the program hangs on the line
"Parameters.ParamByName('NoAff').Value := P1;" and I must kill the task.

R.C.

"Alain Sienaert" <asiena...@hotmail.com> a crit dans le message news:
3b8d11c7_2@dnews...

Quote
> Rgis,

> Did you run the Microsoft ComCheck program? This program checks for
> incompatibilities related to database stuff like ADO, ODBC, etc...
> Hope this helps,
> --

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


I had a similar problem which I solved (sic) by adding a second TQuery. For
some reason resuing a query seems to cause problems

--
Brian
Digital Wired Limited
http://www.ninstall.com

Quote
"Regis" <r.clus...@datasoft.fr> wrote in message news:3b8e3b27_2@dnews...
> Unfortunately I made it. It's OK and I still have the problem.
> In fact I made a new project with only a form, a button and that AdoQuery.
> The result is a bit different.
> When I first try to insert an already existing record, it works. But when
I
> try a second time, the program hangs on the line
> "Parameters.ParamByName('NoAff').Value := P1;" and I must kill the task.

> R.C.

> "Alain Sienaert" <asiena...@hotmail.com> a crit dans le message news:
> 3b8d11c7_2@dnews...
> > Rgis,

> > Did you run the Microsoft ComCheck program? This program checks for
> > incompatibilities related to database stuff like ADO, ODBC, etc...
> > Hope this helps,
> > --

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


Mores informations :

I made the same treatment on ORACLE V7.3 and it worked perfectly. I suppose
now that the problem must come from the IBM provider.

Rgis

"Regis" <r.clus...@datasoft.fr> a crit dans le message news:
3b8cfd29$1_2@dnews...

Quote
> 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)


Quote
> I am having same problem with Firebird 1.0 beta and Intersolve ODBC

driver.

Oops. Forgot to mention , that I never got this error with SQL Server :)

Tauseef

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


I am having same problem with Firebird 1.0 beta and Intersolve ODBC driver.

Tauseef

Other Threads