Click to See Complete Forum and Search --> : ADO.Net Connection String


jehanzeb_bs
April 5th, 2003, 05:00 PM
hello
i want to connect to a database named 'Colege' which is designed in Microsoft Access. Can anybosy tell me what will the connecion string for it. plz tell me the connection string of both SQL Cliet and OLEDB.

Tanks in advance
Bye
Jeanzeb Musani

wjs_nc
April 8th, 2003, 10:59 AM
http://www.fawcette.com/vsm/2002_07/online/hottips/vaughn/default.asp

Dim strConnect As String = _
"Provider=Microsoft.Jet.OLEDB.4.0;Password='';_
& "User ID=Admin;Data Source=C:\NEW40.MDB;"

'with a DSN'
Dim strConnect As String = _
& "DSN=Betav9DSN;database=biblio;" _
& "connection timeout=2;UID=fred;pwd=xx"

'without using a DSN'
Dim strConnect As String = _
& "SERVER=betav9;Driver={Sql Server};" _
& "UID=fred;pwd=xx;"

'without using a DSN using Windows auth.'
Me.SqlConnection1.ConnectionString = "data source=sqlservernamehere;initial catalog=databasenamehere;integrated security=SSPI;persi" & _
"st security info=False;packet size=4096"