Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Long File names with SQL DMO

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2001-07-23 : 00:34:43
Vindana writes "dear SQL TEAM,
I was trying to write a backup/restore program for our comapany. I know there are hundreds of examples for SQL DMO backup/restore processes. But my problem is that when long file names with SPACES the backup method fails, Of course giving errors.

I am using SQL 2000 running on windows 2000 server. My machine is Windows ME. and using VB 6 with SP5

EG.
----------------------------------------------------------------
Public Sub DmoBackupPro(DmoServer As sqldmo.SQLServer, DataBase As String)


Dim DmoBackup As New sqldmo.Backup

On Error GoTo ErrLog


DmoBackup.DataBase = DataBase
DmoBackup.Files = """" & DmoServer.Registry.SQLDataRoot & "\" & DataBase & ".BAK" & """"


' Backup the database.
DmoBackup.SQLBackup DmoServer 'Here it fails


Set DmoServer = Nothing
Set DmoBackup = Nothing
Set fsoBKP = Nothing
Exit Sub
ErrLog:
MsgBox Err.Description & " Process May not be Complete", vbCritical, "Message"
On Error GoTo 0

End Sub
---------------------------------------------------------------

************
here the DmoServer.Registry.SQLDataRoot will return C:\program files\microsoft SQl server\MSQL$LIVE

when I replaced the string with something like "C:\test" It works.

So please Help me.

Thanks.

Vindana



"
   

- Advertisement -