Problem set up connection string to SQL server (Using ADO in VB)

Hi,

i'm VB beginner. Lately i try out using the ADO to retrieve data frm SQL server, but connection problem encouter when i run it.

SQL server 7 is locally installed type (local) as server name, & use Window NT Integreted security as log on to the server. (no username/passward needs)

My VB code:

Dim cnnConnection As ADODB.Connection

Set cnnConnection = New Connection

cnnConnection.ConnectionString = "Provider=sqloledb;" & _
"Data Source (local); Initial Catalog=BigBank;"

cnnConnection.Open
.........

Error:Invalid Connection String Attribute.

Any advise will be sincerely appreciated.

Regards
Chris

[755 byte] By [Chrisine] at [2008-2-23]
# 1
I'm not certain but the problem may be "Data Source (local)". In the past I've found the following MSDN link helpful in generating connection strings:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemdatasqlclientsqlconnectionclassconnectionstringtopic.asp

It seems to imply that the string should look more like "Data Source=(local)" or "server=.".

Hope this helps,
Vaughn

VaughnWashington at 2007-9-9 > top of Msdn Tech,SQL Server,SQL Server Data Access...
# 2
Vaughn,

Thks for the help.

Yat, we might familiar to see almost the SQL connection (with book reference) are "Provider=xx; Data source=(local); Intial catalog=xx; User Id=sa; Password;".

However, i found the solution for my code which tough by other pp.
You can get to below link for future reference.

Link: http://www.carlprothman.net/Default.aspx?tabid=87#OLEDBProviderForSQLServer

Best Regards
Chris

Chrisine at 2007-9-9 > top of Msdn Tech,SQL Server,SQL Server Data Access...

SQL Server

Site Classified