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

Question about using DSN ? 1

Status
Not open for further replies.

garymgordon

Programmer
Apr 5, 2000
307
US
Well, here's my question.

I have no problem in setting up an ADODB.Connection to a SQl server and the database. It works fine.

But, I am trying to learn and I am reading about DSN and simply want to understand it.

But, when I set up the code (as they describe), which looks like:

Set DBConn = Server.CreateObject("ADODB.Connection")
DBConn.Open "DSN=IssuesLog" ' Database name is IssuesLog

I get the error of:

Error Type:
Microsoft OLE DB Provider for ODBC Drivers (0x80004005)
[Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified

So, I didn't know if the "Set" line is correct or not, and I didn't know if the DSN file (IssuesLog.dsn) had to be on the webserver or not (or where it needs to be in order to work), ????

I am just confused.

If someone could explain how I can use DSN (to connect to an .mdb file (Access) or to an SQL database), and the stuff I should be aware of, etc. .... I would greatly appreciate it.

Thanks,
Gary
Gary M. Gordon, LLC
webmaster@garymgordon.com
Certified Web Developer ::
Application Programmer
 
you need to create a new dsn. if you're using win95/98/nt go to Control Panel/ODBC Data Sources (32bit).

under windows 2000 go to Administrative Tools/Data sources (ODBC).

select the System DSN tab, click on Add and select the desired driver. click on Finish. add a name, select server etc...
the name you entered is what you use in your asp code when doing DBConn.Open "DSN=IssuesLog" (-:
 
stakadush,

I did that. In fact, that is exactly what I did.

But, when I put this into my code, ... I get the error.

So, that is why I was curious as to where the IssuesLog.dsn file had to be.

For example, if the IssuesLog.dsn is on MY personal computer, in my c:\Program Files\Common Files\ODBC\Data Sources folder, then how will that file be found by someone else who views my asp page (which is on the web server ... which is not my personal computer) ???

I am working on an individual PC.
The asp page is on an IIS server (windows 2000).
The SQL database is on another server.

Does this additional information help?

:)

Any thoughts?

Gary

Gary M. Gordon, LLC
webmaster@garymgordon.com
Certified Web Developer ::
Application Programmer
 
the dsn has to be configuered on the server running IIS (the server running your ASP script). is it possible for you to configure new dsn's on the win2000 server?
it doesn't matter where the SQL server is,as long as you can access it from remote.
(-:
 
Well, ... haha

After I created the DSN on the server (that holds the asp script) ... it is fine. I just needed to added the UID and PWD for it to work. But it is good now.

Thanks!!!!

I think that is about it for now.

But ....... I will return (with more questions in the future) ... if you don't mind.

LOL

Bye for now.

Gary
Gary M. Gordon, LLC
webmaster@garymgordon.com
Certified Web Developer ::
Application Programmer
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top