Computing.Net > Forums > Programming > Sql connection string VB6

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Sql connection string VB6

Reply to Message Icon

Name: Anthony Arde
Date: March 8, 2005 at 02:32:39 Pacific
OS: winxp pro sp2
CPU/Ram: 386mb ram p3 733
Comment:

OK im trying to connect my local machine to my local sql database in VB6 but the connection strings i`ve tried dont work, i have set ado 2.7 as a reference ,the sql service is running
as server name "ANTHONYW" another c++ database program works with this set up, i just need the correct connection string for vb6, Please help, Thanks Ant.



Sponsored Link
Ads by Google

Response Number 1
Name: secrets
Date: March 8, 2005 at 08:38:40 Pacific
Reply:

try this:
dim cn As New ADODB.connection
dim rs As New ADODB.Recordset
'To Opent the Connection
If cn.state = 0 Then cn.Open "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=yourdatabasenamehere;Data Source=."
'Put Your Database name as Initial Catalog

if you are running a single database server in your envoirnment then don't change "." at Datasource in connection string otherwise replace "." with your sqlserver name.


0
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: Sql connection string VB6

sql connecting string for html www.computing.net/answers/programming/sql-connecting-string-for-html/12714.html

SQL Server Connecting String www.computing.net/answers/programming/sql-server-connecting-string/10102.html

VB6 Mysql remote connection string www.computing.net/answers/programming/vb6-mysql-remote-connection-string/13709.html