Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VB6 connection string using DSN

Status
Not open for further replies.

dmando84

Programmer
Dec 28, 2005
68
US
Hello,

I am trying connect a VB6 application to SQL Server using a DSN which I created. I am having alot of problems. Any help would be appreciated.

Dave
 
You many want to try the VB forums. What code do you have so far? What are the problems you are having?


Jim
 
This is what I have so far.. but, I keep getting an error message saying that the connection string is not valid..
What is the proper syntax for this?

Thank you,
Dave



Public Sub ConnectToDatabase()
Set cnn = New ADODB.Connection
sCnn = "Provider=SQLOLEDB; Initial Catalog=DataBaseName;Data Source=DSN;"

End Sub
 
sCnn[!].ConnectionString[/!] = "Provider=SQLOLEDB; Initial Catalog=DataBaseName;Data Source=DSN;"

-George

Strong and bitter words indicate a weak cause. - Fortune cookie wisdom
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top