Connection String

If i want to connect to a sql database without using the data enviornment what is the connection string? i know the string for an access db, how different is it? any ideas?
thanks,
j
[195 byte] By [jamoon] at [2007-11-18 2:05:28]
# 1 Re: Connection String
This what you are looking for?

StrConnection = "Provider=sqloledb;Data Source=MyDataSource;Initial Catalog=MyDBname;User Id=MyUserID;Password=MyPassword; "
JimB at 2007-11-10 0:02:45 >
# 2 Re: Connection String
Dim dbSQLConnection As Connection
'
Set dbSQLConnection = New Connection
'
With dbSQLConnection
.Provider = "SQLOLEDB"
.ConnectionString = "User ID=" & strLogin & _
";Password=" & strPassw & _
";Data Source=" & strServer & _
";Initial Catalog=" & strDBName
.Open
End With
Andrew R. at 2007-11-10 0:03:56 >
# 3 Re: Connection String
I like the code AndrewR. Questions for you. Am assuming strDBName = db file path? Where do you grab strServer ?
doofusboy at 2007-11-10 0:04:53 >
# 4 Re: Connection String
Its your server's name check your network.
ta9347 at 2007-11-10 0:05:48 >
# 5 Re: Connection String
How do you know what the different providers are? eg for Access its Provider=Microsoft.Jet.OLEDB.4.0 and for SQL its Provider = "SQLOLEDB"? Also how do you know what the others properties are?

Thanks for any help?

JP
jp140768 at 2007-11-10 0:06:58 >
# 6 Re: Connection String
...if you do not whant to look in msdn, you can put a dataControl on a form, right click on it and choose properties to make it help you build a connection string: you choose Db type, and it will build a string for you with correct provider...
Then you can cut and paste that string where you need, and throw away the control.
Cimperiali at 2007-11-10 0:07:52 >
# 7 Re: Connection String
This page helped me a couple of time :)

http://www.able-consulting.com/ADO_Conn.htm

JeffB
JeffB at 2007-11-10 0:08:54 >