Red Gate forums :: View topic - User Instances / AttachDBFile
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

User Instances / AttachDBFile

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



Joined: 04 Jan 2006
Posts: 3
Location: Charlottesville, Va

PostPosted: Thu Jan 12, 2006 12:14 am    Post subject: User Instances / AttachDBFile Reply with quote

will the new 4.0 beta support Syncing with user instances and attachDBFile?

is there an rss feed or email list when the new 4.0 is released and will it be compatible with the 2.0 framework?

Deepest Regards,
Michael
Back to top
View user's profile Send private message
Brian Donahue



Joined: 23 Aug 2004
Posts: 6670

PostPosted: Tue Jan 24, 2006 6:23 pm    Post subject: Reply with quote

Hello,

All of the programs in SQL Bundle 4.0 are compatible with .NET Framework 2.0. They require Framework 1.1, which is the Framework version they're targeted at.
Back to top
View user's profile Send private message
Brian Donahue



Joined: 23 Aug 2004
Posts: 6670

PostPosted: Tue Jan 24, 2006 6:54 pm    Post subject: Reply with quote

Attachfile seems to work, but it's officially unsupported by the software. To get it working, you can enter the name of a SQL Server 2005 into the server box, followed by the attachdbfilename command:
Code:
BRIAN\SQL2005;AttachDBFileName=c:\temp\mydb.mdf

You will need a powerful account (probably sa) to log into the SQL Server 2005 in the logon credentials in SQL Compare, and also a database name to attach the file as. SQL Server 2005 will then attach the file to the server and you can compare it as a database.

This saves you the additional step of attaching the file using the Management Studio before using SQL Compare/Data Compare to compare the database in the file.
Back to top
View user's profile Send private message
jprice2269



Joined: 02 Dec 2007
Posts: 7

PostPosted: Thu Dec 13, 2007 12:15 am    Post subject: Still cant get this to work Reply with quote

I create a string to hold the name of the database and the attach string property, and, even though I test to make sue the file exists, the register command still says it doesnt... Any ideas?

Public Sub SourceDatabase(ByVal serverName As String, ByVal databaseName As String, ByVal userName As String, ByVal password As String)
Dim _connectionProperties As Engine.ConnectionProperties

Dim _combinedServerName As String

m_db1 = New Engine.Database

If FileIO.FileSystem.FileExists(databaseName) Then
_combinedServerName = String.Concat(serverName, "; AttachDBFileName=", databaseName)
databaseName = "Source"
Else
_combinedServerName = serverName
End If

If String.IsNullOrEmpty(userName) Then
_connectionProperties = New Engine.ConnectionProperties(_combinedServerName, databaseName)
_connectionProperties.IntegratedSecurity = True
Else
_connectionProperties = New Engine.ConnectionProperties(serverName, databaseName, userName, password)
End If

m_db1.Register(_connectionProperties, m_engineOptions)
End Sub
Back to top
View user's profile Send private message
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