Delphi Update access database
Procedure FaktUpdateNotes(DbNr,Notes:string);Var
TQ : TADOQuery;
FilNavn : String;
Begin
//
// Findes database?
FilNavn:=ExtractFilePath(Application.ExeName);
While Filnavn[Length(FilNavn)]='\' Do FilNavn:=Copy(FilNavn,1,Length(FilNavn)-1);
FilNavn:=StringReplace(GemIAccess,'$programdir',FilNavn,[rfIgnoreCase,rfReplaceAll]);
If FileExists(FilNavn) Then Begin
TQ:=TADOQuery.Create(Nil);
Try
TQ.ConnectionString:=ConnectIt+FilNavn;
// Put i Notes
TQ.SQL.Clear;
TQ.SQL.Add('INSERT INTO Kartotek (Notat) VALUES(');
TQ.SQL.ADD(''''+Notes+''',');
TQ.ExecSQL;
Finally
TQ.Free;
End;
End; // FileExists
End;
Jeg har følgende kode - skal ændres til Update istedet.
Procedure FaktUpdateNotes(DbNr,Notes:string);
"DbNr" indeholder den post der skal opdateres i access "Debitornr"
"Notes" er indholdet som skal opdateres i access felt "Notes"
