Red Gate forums :: View topic - Compare SQL Native Backup to LiveDatabase
Return to www.red-gate.com RSS Feed Available

Search  | Usergroups |  Profile |  Messages |  Log in  Register 
Go to product documentation
SQL Toolkit Previous Versions
SQL Toolkit Previous Versions forum

Compare SQL Native Backup to LiveDatabase

Search in SQL Toolkit Previous Versions forum
Post new topic   Reply to topic
Jump to:  
Author Message
rockywurden



Joined: 10 Dec 2007
Posts: 6

PostPosted: Mon Dec 10, 2007 11:16 pm    Post subject: Compare SQL Native Backup to LiveDatabase Reply with quote

I can compare 2 databases.
What do I need to change DB1 to a SQL Backup file?
Thanks


Imports RedGate.SQL.Shared
Imports RedGate.SQLCompare.Engine
Imports RedGate.SQLDataCompare.Engine
Imports RedGate.SQLDataCompare.Engine.ResultsStore
Imports RedGate.SQLCompare.BackupReader

Dim db1 As New Database
Dim db2 As New Database

db1.RegisterForDataCompare(New ConnectionProperties(sServer, sDatabase))
db2.RegisterForDataCompare(New ConnectionProperties(tServer, tdatabase))
......
Back to top
View user's profile Send private message
richardjm



Joined: 20 May 2005
Posts: 359
Location: Red Gate Software Ltd

PostPosted: Wed Dec 12, 2007 10:02 am    Post subject: Reply with quote

You'll need an extra Import...

Code:

Imports RedGate.SQLCompare.BackupReader


You'll also need to make sure you have the following files with your program...

Code:

RedGate.BackupReader.dll
RedGate.BackupReader.SqbReader.dll
RedGate.SQLCompare.BackupReader.dll
System.Data.SQLite.dll
rglz.dll
zlib1.dll


And the code is simply...

Code:

Dim db1 as New BackupDatabase
db1.RegisterForDataCompare(New String() {"c:\\widgetdev.sqb"}, New String() {"password"}, Nothing)


The third argument is a backupset which is irrelevant for sqb files, the string arrays are used so you can pass multiple files. For each file you can set the password. If you don't have passwords you can simply omit this argument e.g....

Code:

Dim db1 as New BackupDatabase
db1.RegisterForDataCompare(New String() {"c:\\widgetdev.sqb"}, Nothing)


HTH
_________________
Richard Mitchell
Project Manager
Red Gate Software Ltd
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Reply to topic All times are GMT + 1 Hour
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group