Board index » delphi » Access Violation in msado15.dll

Access Violation in msado15.dll

Hi All,

Since I upgraded to SQLServer 2000 from v7, I get an AV when doing an INSERT
and calling ExecSQL, I have tried upgrading the version of MDAC to 2.7 to no
avail, has anyone had this problem.

Win2000
SQLServer 2000
Delphi 5 E with all updates

--
Mark

 

Re:Access Violation in msado15.dll


Quote
>Since I upgraded to SQLServer 2000 from v7, I get an AV when doing an INSERT
>and calling ExecSQL, I have tried upgrading the version of MDAC to 2.7 to no
>avail, has anyone had this problem.

Are you using a TadoQuery component and changing the comandtext from a query
that returns a dataset?
--
Brian Bushay (TeamB)
Bbus...@NMPLS.com

Re:Access Violation in msado15.dll


Thanks for the reply Brian,

I'm not quite sure what you mean, here is an example of a function that
fails and causes the AV. (What else should I be doing, also this code has
been working until I upgraded???)

procedure TdmBulkUploadThreadDB.WriteFileLog(nUploadFolderID, nAssetID,
  nStatus : Integer; szOrigFilename, szNewFilename : string );
var
  ADOQry : TADOQuery;
  nNextID : Integer;
begin
  ADOQry := TADOQuery.Create(nil);
  try
    ADOQry.Connection := GlobalADOConn;
    ADOQry.Close;
    ADOQry.SQL.Clear;
    ADOQry.SQL.Add('SELECT MAX(nFileLogID) FROM BUFileLog ');
    ADOQry.Open;
    if( ADOQry.Fields[0].IsNull )then
      nNextID := 1
    else
      nNextID := ADOQry.Fields[0].AsInteger + 1;
    ADOQry.Close;
    ADOQry.SQL.Clear;
    ADOQry.SQL.Add('INSERT INTO BUFileLog ');
    ADOQry.SQL.Add('( nFileLogID, nUploadFolderID, nAssetID, nStatus, ');
    ADOQry.SQL.Add('szOriginalFilename, szAssetFilename, daDateTime ');
    ADOQry.SQL.Add(') VALUES ( ');
    ADOQry.SQL.Add( IntToStr(nNextID) + ', ' );
    ADOQry.SQL.Add( IntToStr(nUploadFolderID) + ', ' );
    ADOQry.SQL.Add( IntToStr(nAssetID) + ', ' );
    ADOQry.SQL.Add( IntToStr(nStatus) + ', ' );
    ADOQry.SQL.Add( '''' + StringReplace(szOrigFilename, '''', '-',
[rfReplaceAll] ) + ''', ' );
    ADOQry.SQL.Add( '''' + StringReplace(szNewFilename, '''', '-',
[rfReplaceAll] ) + ''', ' );
    ADOQry.SQL.Add( 'getdate() ) ' );
    ADOQry.ExecSQL;
    ADOQry.Close;
    ADOQry.Free;
  except
    on E: EDataBaseError do
    begin
      ADOQry.Free;
      WriteErrorLog(nUploadFolderID, 'Error: EDataBaseError (WriteFileLog)
Error Writing File Log');
    end;
  end;
end;

Thanks again

Mark Redman

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

Quote

> >Since I upgraded to SQLServer 2000 from v7, I get an AV when doing an
INSERT
> >and calling ExecSQL, I have tried upgrading the version of MDAC to 2.7 to
no
> >avail, has anyone had this problem.
> Are you using a TadoQuery component and changing the comandtext from a
query
> that returns a dataset?
> --
> Brian Bushay (TeamB)
> Bbus...@NMPLS.com

Re:Access Violation in msado15.dll


Quote
>I'm not quite sure what you mean, here is an example of a function that
>fails and causes the AV. (What else should I be doing, also this code has
>been working until I upgraded???)

That is the problem situation I asked about.
Use a TadoDataset for the first query and a TadoCommand for the second query.

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

Re:Access Violation in msado15.dll


Thanks Brian, that definately sorted it out,

Is this a bug somewhere? Should a TADOQuery work?

Mark

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

Quote

> >I'm not quite sure what you mean, here is an example of a function that
> >fails and causes the AV. (What else should I be doing, also this code has
> >been working until I upgraded???)

> That is the problem situation I asked about.
> Use a TadoDataset for the first query and a TadoCommand for the second
query.

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

Other Threads