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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DNS Connection

Status
Not open for further replies.

JKingdom

Programmer
Joined
May 9, 2004
Messages
141
Location
AE
hi ,,

usually i don;t use DNS to connect the data base to my VB6 application coz i place the database in the application path ..

now i would like to know how the code line looks like if i wanted to connect through DNS .. i want both wats of connecting to sql and Access ..

thanks alot ..
 
am using this way currently :

Set cnFinance = New ADODB.Connection

Dim sConnect As String

sConnect = "Provider = Microsoft.Jet.OLEDB.4.0;Data Source= finance.mdb"

cnFinance.Open sConnect
 
So..... still not read faq222-2244!

If you had you would have found that search turns up many hits, including recently thread222-1021936 and there is FAQ222-4845.

There is also:
Code:
Set cnFinance = New ADODB.Connection
With cnFinance
	.Provider = "MSDASQL"
	.ConnectionString = "DSN=myDSNname;UID=Admin;PWD=mypassword;LockType=3;Mode = 3"
	.open
end with

but my best advice is to read faq222-2244 - and use it please!

________________________________________________________________
If you want to get the best response to a question, please check out FAQ222-2244 first

'If we're supposed to work in Hex, why have we only got A fingers?'

Essex Steam UK for steam enthusiasts
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top