-----------------------------------------------------------

New Message on BDOTNET

-----------------------------------------------------------
From: Nagamani
Message 1 in Discussion

I am writing a backup routine for sql server database using SQL DMO Objects.   The 
code is : *************** SQLDMO.SQLServer2Class MyServer = new 
SQLDMO.SQLServer2Class(); MyServer.Connect("ServerName", "LoginName", "PassWord");   
SQLDMO.Backup2Class BackUp = new SQLDMO.Backup2Class(); BackUp.Action = 
SQLDMO.SQLDMO_BACKUP_TYPE.SQLDMOBackup_Database; BackUp.Database = "DatabaseName"; 
BackUp.Files = "C:\New Folder\Database.bkp"; BackUp.Initialize = true;   
BackUp.SQLBackup (MyServer);   ***********************   When i execute this code.  I 
get the following error: 18204 :  
BackupDiskFile::CreateMedia: Backup device ''D:\New' failed to create. Operating 
system error = 123(The filename, directory name, or volume label syntax is 
incorrect.). 
------- 
I tried to get the sql generated by the dmo by using: 
BackUp.GenerateScript() method. 
The Script is : 
BACKUP DATABASE [CHASE] TO  DISK = N'D:\new',  DISK = N'Folder\CHASE.bkp' WITH  INIT , 
 NOUNLOAD ,  NOSKIP ,  STATS = 10,  NOFORMAT  
--- 
Dmo is treating whitespace in the file path as delimiter and creating two DISKs  Which 
is not proper. 
the script should be like this: 
BACKUP DATABASE [CHASE] TO  DISK = N'D:\New Folder\CHASE.bkp' WITH  INIT ,  NOUNLOAD , 
 NOSKIP ,  STATS = 10,  NOFORMAT  
Can any one help how to acheive this? 
How can we give the path with spaces to the backup object? 
Thanks.Nagamani

-----------------------------------------------------------

To stop getting this e-mail, or change how often it arrives, go to your E-mail 
Settings.
http://groups.msn.com/BDOTNET/_emailsettings.msnw

Need help? If you've forgotten your password, please go to Passport Member Services.
http://groups.msn.com/_passportredir.msnw?ppmprop=help

For other questions or feedback, go to our Contact Us page.
http://groups.msn.com/contact

If you do not want to receive future e-mail from this MSN group, or if you received 
this message by mistake, please click the "Remove" link below. On the pre-addressed 
e-mail message that opens, simply click "Send". Your e-mail address will be deleted 
from this group's mailing list.
mailto:[EMAIL PROTECTED]

Reply via email to