List Info

Thread: a delphi question




a delphi question
user name
2006-08-17 12:20:35

Hi
I want to backup my SQL server database,but the operation doesn't run while my service manager is start ,when I stop that I can take a backup.
I have used these commands to do that,I don't know how to use a sql command to backup.please guide me.
//***********
AdoConnection1.Connected:=False;
S:=ExtractFilePath(Application.ExeName)+'data\storage1_Data.mdf';
Sourec1:=TfileStream.Create(S,FmOpenRead);
Dest1:=TFileStream.Create('c:\storage1_Data.mdf',FmCreate);
Try
comprStream1 := TCompressionStream.Create(clFastest, Dest1);
try
comprStream1.CopyFrom(Sourec1, Sourec1.Size);
comprStream1.CompressionRate;


---------------------------------
Do you Yahoo!?
Everyone is raving about the all-new Yahoo! Mail Beta.

[Non-text portions of this message have been removed]

__._,_.___
.

__,_._,___
a delphi question
user name
2006-08-18 04:15:00

I use this command to backup my MSSQL Database

Var Ch:= Char(39);

St1:=DateToStr(Date);Delete(st1,3,1);Delete(st1,5,1);

St2:=TimeToStr(Time);Delete(st2,3,1);Delete(st2,5,1);

st:='Hermes.'+;St1+'.'+St2+'.bak';

st:=BackUpPath+'\'+st;st1:=Char(39);

s:='Backup Database Hermes to disk='+;ch+st+ch+' with INIT';

Then put the variable s into your routine that you use for commands

This works great.

Steve

_____

From: delphi-enyahoogroups.com [mailto:delphi-enyahoogroups.com] On Behalf
Of salma s
Sent: 17 August 2006 13:21
To: delphi-enyahoogroups.com
Subject: [delphi-en] a delphi question

Hi
I want to backup my SQL server database,but the operation doesn't run while
my service manager is start ,when I stop that I can take a backup.
I have used these commands to do that,I don't know how to use a sql command
to backup.please guide me.
//***********
AdoConnection1.Connected:=False;
S:=ExtractFilePath(Application.ExeName)+'data\storage1_Data.mdf';
Sourec1:=TfileStream.Create(S,FmOpenRead);
Dest1:=TFileStream.Create('c:\storage1_Data.mdf',FmCreate);
Try
comprStream1 := TCompressionStream.Create(clFastest, Dest1);
try
comprStream1.CopyFrom(Sourec1, Sourec1.Size);
comprStream1.CompressionRate;

---------------------------------
Do you Yahoo!?
Everyone is raving about the all-new Yahoo! Mail Beta.

[Non-text portions of this message have been removed]

[Non-text portions of this message have been removed]

__._,_.___
.

__,_._,___
[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )