Click to See Complete Forum and Search --> : Load SQL Server database?


megaxoom
May 9th, 2004, 07:29 PM
Hello everyone

To load a Microsoft Access from a specific location, I just use the following example connection string:

string fileLoc = "D:\\database\\myaccess.mdb";

string connStr = @"Jet OLEDB:Global Partial Bulk Ops=2;Jet OLEDB:Registry Path=;Jet OLEDB:Database Locking Mode=1;Data Source=";

connStr += fileLoc + SOME_OTHERINFO


Now my is can this be done the same to Microsoft SQL Server.

If yes, please provide and example. If no, please provide information on how to load the SQL Server.

Thanks for any help.

trekmp
May 11th, 2004, 11:46 AM
Private dBase As SQLConnection

Public Sub OpenData(sDB As String,sSource As String,sUser As String)

Dim sConn As String
sConn="Data Source=" & sSource & ";Initial Catalog=" & sDB & ";UID=" & sUser & ";"
dBase = New SqlConnection(sConn)
dBase.Open()

End Sub

I tend to wrap all this up in a class