Autor Beitrag
Mausi
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 21



BeitragVerfasst: Mi 17.09.03 09:51 
Hallo Delphi Gemeinde,

kann mir einer von euch evtl. einen Tipp geben, wie ich schnell und einfach eine mdb-Datei von einen Ort zu einem anderen Ort kopiere?

mfg
UWER
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 79

SUSE 8.1, XP Home
D7 Prof. , Kylix 3
BeitragVerfasst: Mi 17.09.03 16:15 
Hallo Mausi,

da gibt es diese wunderhübsche API-Funktion CopyFile, mit der kann ich wunderbar Files von a nach b kopieren. z.B. so:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
var
   sSource, sDest : string;
begin
   sSource := 'a.mdb';
   sDest := '\backup\b.mdb'

   CopyFile(PChar(sSource), PChar(sDest), FALSE);
end;

Für weitere Infos einfach in der Hilfe nachschauen. Bzw. mal den Cursor auf CopyFile setzen und F1 drücken

Moderiert von user profile iconTino: Code- durch Delphi-Tags ersetzt.

_________________
Gruß
UWER
Licki
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 132

Knoppix, Win 95, Win 2000, Win NT, Win 98, Win XP
Delphi 3
BeitragVerfasst: Do 18.09.03 09:13 
ausblenden volle Höhe Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, ComCtrls, ExtCtrls, Buttons;

type
  TForm1 = class(TForm)
    Button1: TButton;
  private
   procedure CopyFile(const Dateiname, ZielDatei: String);
  public
 end;

var
  Form1: TForm1;

implementation

{$R *.DFM}

procedure TForm1.Button1Click(Sender: TObject);
 var
  Dateiname: String;
  ZielDatei: String;
 begin
  Dateiname:='prisma.dat';
  ZielDatei:='A:\prisma';
  CopyFile(Dateiname, ZielDatei);
 end;

end.
Luckie
Ehemaliges Mitglied
Erhaltene Danke: 1



BeitragVerfasst: Do 18.09.03 14:41 
@Licki: Was soll das geben?
Mausi Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 21



BeitragVerfasst: Di 23.09.03 07:41 
Danke für den Tipp hat sehr geholfen.