Click here to Skip to main content
15,885,546 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: VB and MDB Pin
Wayne Gaylard8-Sep-11 1:27
professionalWayne Gaylard8-Sep-11 1:27 
GeneralRe: VB and MDB Pin
hansoctantan8-Sep-11 3:51
professionalhansoctantan8-Sep-11 3:51 
GeneralRe: VB and MDB Pin
Wayne Gaylard8-Sep-11 4:01
professionalWayne Gaylard8-Sep-11 4:01 
GeneralRe: VB and MDB Pin
hansoctantan8-Sep-11 5:46
professionalhansoctantan8-Sep-11 5:46 
GeneralRe: VB and MDB Pin
Simon_Whale8-Sep-11 6:24
Simon_Whale8-Sep-11 6:24 
AnswerRe: VB and MDB Pin
Luc Pattyn8-Sep-11 4:34
sitebuilderLuc Pattyn8-Sep-11 4:34 
AnswerRe: VB and MDB Pin
Eddy Vluggen8-Sep-11 6:57
professionalEddy Vluggen8-Sep-11 6:57 
QuestionRestore failed for Server '...\SQLEXPRESS' Pin
C#Coudou7-Sep-11 23:41
C#Coudou7-Sep-11 23:41 
hi everyone,
I always got an error Restore failed for Server '...\SQLEXPRESS'
I googled it already and bunch of result.
but still, i can't solve it.
Details:
*windows xp
*sql server 2005 using PCNAME\SQLEXPRESS, (windows authentication mode)
*visual studio 2005
*filePath= C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Backup\DBNAME.bak

note: sometimes it goes successfully but sometimes got an error.

please help! thanks in advance.

here's the code
VB
Using cnn As New SqlConnection(constrSQL)
            cnn.Open()
            dbName = cnn.Database.ToString()
            cnn.ChangeDatabase("master")
            Dim sc As New ServerConnection(cnn)
            Dim sv As New Server(sc)
            ' Create backup device item for the backup
            filePath = Path.Combine(filePath, databaseName & ".bak")
            Dim bdi As New BackupDeviceItem(filePath, DeviceType.File)
            ' Create the restore object
            Dim resDB As New Restore()
            resDB.Database = dbName
            resDB.Action = RestoreActionType.Database
            resDB.ReplaceDatabase = True
            resDB.NoRecovery = False
            resDB.Devices.Add(bdi)
            resDB.PercentCompleteNotification = 10
            AddHandler resDB.PercentComplete, AddressOf ProgressEventHandler
            resDB.Database = dbName
            ' Restore the database
            Try
                resDB.SqlRestore(sv)
                sv.Refresh()
                sv = Nothing
            Catch ex As Exception
                log.Debug(ex.ToString)
                Throw (ex)
            End Try
        End Using

C# コードMicrosoft End User
2000-2008




「「「「「「「「「「「「「「「「「「「「「「「「「「「「
The best things in life are free
」」」」」」」」」」」」」」」」」」」」」」」」」」」」


AnswerRe: Restore failed for Server '...\SQLEXPRESS' Pin
Pradeep Shukla8-Sep-11 7:42
professionalPradeep Shukla8-Sep-11 7:42 
GeneralRe: Restore failed for Server '...\SQLEXPRESS' Pin
C#Coudou8-Sep-11 13:45
C#Coudou8-Sep-11 13:45 
AnswerRe: Restore failed for Server '...\SQLEXPRESS' Pin
Eddy Vluggen8-Sep-11 9:59
professionalEddy Vluggen8-Sep-11 9:59 
GeneralRe: Restore failed for Server '...\SQLEXPRESS' Pin
C#Coudou8-Sep-11 14:12
C#Coudou8-Sep-11 14:12 
QuestionPut red Rectangle arround control [modified] Pin
Sam Martini7-Sep-11 0:16
Sam Martini7-Sep-11 0:16 
GeneralRe: Put red Rectangle arround control Pin
MicroVirus7-Sep-11 0:51
MicroVirus7-Sep-11 0:51 
GeneralRe: Put red Rectangle arround control Pin
Sam Martini7-Sep-11 5:50
Sam Martini7-Sep-11 5:50 
Questiona situation with connection string Pin
alejx6-Sep-11 13:17
alejx6-Sep-11 13:17 
AnswerRe: a situation with connection string Pin
Pradeep Shukla6-Sep-11 19:32
professionalPradeep Shukla6-Sep-11 19:32 
GeneralRe: a situation with connection string Pin
alejx7-Sep-11 2:07
alejx7-Sep-11 2:07 
GeneralRe: a situation with connection string Pin
Pradeep Shukla7-Sep-11 3:37
professionalPradeep Shukla7-Sep-11 3:37 
GeneralRe: a situation with connection string Pin
alejx7-Sep-11 4:34
alejx7-Sep-11 4:34 
GeneralRe: a situation with connection string Pin
Pradeep Shukla7-Sep-11 4:41
professionalPradeep Shukla7-Sep-11 4:41 
GeneralRe: a situation with connection string Pin
alejx7-Sep-11 5:11
alejx7-Sep-11 5:11 
GeneralRe: a situation with connection string [modified] Pin
Pradeep Shukla7-Sep-11 8:36
professionalPradeep Shukla7-Sep-11 8:36 
GeneralRe: a situation with connection string Pin
alejx7-Sep-11 12:59
alejx7-Sep-11 12:59 
GeneralRe: a situation with connection string Pin
Pradeep Shukla7-Sep-11 13:03
professionalPradeep Shukla7-Sep-11 13:03 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.