🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.delphi.database
Article #2055

Re: Access Violation using MSACCESS

#2055
From: Alan Buckle
Date: Mon, 17 Aug 1998 00:00
72 lines
2738 bytes
No, I'm not using that type of construct in this case.

I'm just copying values from a field in one DB to the identical field in
another DB.

For what it's worth I've appended the routine below.

Note  that this error messsage does not appear when the program is run.

Alan

----------
> From: Martin Ziemer <MZiemer@ferrocontrol.de>
> Newsgroups: borland.public.delphi.database;
comp.lang.pascal.delphi.databases
> Subject: Re: Access Violation using MSACCESS
> Date: Sunday, August 16, 1998 3:19 PM
> 
> Alan Buckle wrote:
> 
> > However after processing in excess of 18,000 records (18408 to be
exact,
> > not counting 'child' records ) I get
> > Access Violation at Address 4E5FA1F6 in module 'IDDAO32.DLL'.
> > I'm tearing my few remaining hairs out at this stage. Does anyone have
any
> > ideas ??
> 
> May be. Do You use SQL-constructs like "insert into ... values
> ('+MyString+...')'"? I got such an exception if there was a ":"
> somewhere in MyString! I think the reason is that MSACCESS tries a
> parameter substitution. It's generally more reliable if you use
> TQuery.Params[] for such purposes.
> 
> Bye,
>   Martin
> 


procedure TfrmLoadUpdates.CopyThisRecord (TblSlave :TDataSet; TblMaster :
TDataset);
{
 This Routine copies data from TblSlave to TblMaster on a Field by Field
Basis.
 AutoIncrementing fields are ignored.
}
Var
   i : Integer;
   M : String;
   ThisField : ShortString;
begin
     With TblSlave do begin
          For i := 0 to FieldCount -1 do begin
              ThisField := Fields[i].FieldName;
              If (Fields[i].Datatype <> ftAutoInc) then try
                 TblMaster.FieldByName(ThisField).value :=
TblSlave.Fields[i].value;
              except
                 M := 'ERROR - Failed to Update Field ' + ThisField + ' in
' + TblMaster.Name;
                 M := M + ' This Master and Slave databases may have
differing Field Names or Sizes';
                 beep; beep; beep;
                 ShowMessage ( M);
                 AbortMe := True;
                 exit;
              end;
           end; {for i}
     end; {With }

end;
Technical Details
Message-ID: <01bdc9b6$d1bce3d0$01000a0a@pentium1>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <01bdc84f$8c9e0620$01000a0a@pentium1> <35D6DC76.7741@ferrocontrol.de>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: ffff5,276f600a65905796
X-Google-Attributes: gidffff5,public
X-Google-Thread: 115d96,276f600a65905796
X-Google-Attributes: gid115d96,public
From: "Alan Buckle" <buckle@euronet.nl>
Subject: Re: Access Violation using MSACCESS
Date: 1998/08/17
Message-ID: <01bdc9b6$d1bce3d0$01000a0a@pentium1>
X-Deja-AN: 381887027
References: <01bdc84f$8c9e0620$01000a0a@pentium1> <35D6DC76.7741@ferrocontrol.de>
Organization: EuroNet Internet
Newsgroups: borland.public.delphi.database,comp.lang.pascal.delphi.databases