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

Connecting to a database with system DSN

Status
Not open for further replies.

emozley

Technical User
Joined
Jan 14, 2003
Messages
769
Location
GB
Hi,

I have done a fair bit of database programming with ASP and am now trying to write an application in Visual Basic 2008 (Express Edition).

The problem is that I am having difficulty with some very basic questions but most importantly

Is it possible to connect to a database using a system DSN that I have got set up on my computer? In vbscript I can create a connection object and then say

DB.Open "MYDSN"

Visual Basic does not seem to be completely clear on how to do this.

Thanks very much

Ed
 
In VB6, it's done with an ADO connection object, which I'm sure is supported in VS2K8 (haven't dabbled with it yet though). It's pretty simple if you decide to try - just do a help search on "ADO Connection" or somesuch.

"Don't be irreplaceable. If you can't be replaced, you can't be promoted."
 
You need to use ADO.NET. It's easy to connect, but then what are you going to do with the connection? BTW, no need to use a DSN. You can make a direct connection to the database once you know how to set up the proper parameters.

"I think we're all Bozos on this bus!" - Firesign Theatre [jester]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top