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: [email protected] [mailto:[EMAIL PROTECTED] On Behalf
Of salma s
Sent: 17 August 2006 13:21
To: [email protected]
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]



-----------------------------------------------------
Home page: http://groups.yahoo.com/group/delphi-en/
To unsubscribe: [EMAIL PROTECTED] 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/delphi-en/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



Reply via email to