Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 connect VB6 to SQL server database

Author  Topic 

nounabarbie
Starting Member

10 Posts

Posted - 2006-02-19 : 10:14:38
hi,
When I connect a VB6 form to an access database,I use the following code:
Dim sConDB As String
Public cnnTest As ADODB.Connection

'==
'Connect to Database

sConDB = "Provider=Microsoft.Jet.OLEDB.4.0;"
sConDB = sConDB & "Data Source="
sConDB = sConDB & App.Path & "\databasename.mdb"
Debug.Print sConDB

Set cnnTest = New ADODB.Connection
cnnTest.ConnectionString = sConDB
cnnTest.Open


End Sub
Instead of using an access database,I am using SQL server database,so my question is:what's the code for connecting VB6 form to SQL server database?
Thanks for your help

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2006-02-19 : 17:13:18
Refer to http://www.connectionstrings.com/

----------------------------------
'KH'

Time is always against us
Go to Top of Page
   

- Advertisement -