Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP 3 Classic ASP Active Server Pages 3.0 > Classic ASP Databases
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Classic ASP Databases Discuss using ASP 3 to work with data in databases, including ASP Database Setup issues from the old P2P forum on this specific subtopic. See also the book forum Beginning ASP.NET Databases for questions specific to that book. NOT for ASP.NET 1.0, 1.1, or 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Databases section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old September 9th, 2003, 04:53 PM
Registered User
 
Join Date: Aug 2003
Location: london, london, United Kingdom.
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to bjtindle
Default Data source name not found and no default driver s

I've been looking desperately for a solution to this error that keeps cropping up - it seems to be quite common with beginners. I am trying to connect to a remote host - the script I found in their FAQs is as follows:

DSN=DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" & Server.Mappath("filename.mdb")
OBJdbConnection.Open(DSN)


Since I got errors I have fiddled around with the code at present it looks like this:

Dim objConn,objRS,DSN
Set objConn = Server.CreateObject("ADODB.Connection")
Set objRS = Server.CreateObject("ADODB.Connection")

DSN = "DRIVER =(Microsoft Access Driver (*.mdb)};"
DSN = DSN & "DBQ=" & Server.Mappath("Emailing_List.mdb")
objConn.open

Can you think of any errors I might be making - could it be an error elsewhere in the code or would the only cause of error be found here? Or do you think it's likely to be a problem with the host?

Any pointers would be much appreciated!

Thanks,

Becky

Reply With Quote
  #2 (permalink)  
Old September 10th, 2003, 02:51 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: , , United Kingdom.
Posts: 1,212
Thanks: 0
Thanked 1 Time in 1 Post
Default

You don't say what errors you are getting so all I can give you is some general pointers:
1. don't use that Microsoft Access driver in ASP, you should use the Jet OLEDB driver instead. See http://www.able-consulting.com/ADO_Conn.htm for examples.
2. make sure the relative path to your database is correct - your examples would only work if the database is in the same folder as the ASP page.

hth
Phil
Reply With Quote
  #3 (permalink)  
Old September 10th, 2003, 03:29 AM
Authorized User
 
Join Date: Jun 2003
Location: Witham, Essex, United Kingdom.
Posts: 33
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Some hosting suppliers do not allow DSN-less connections, so it's always useful to know how to use them.

If I get this error message it usually means that the DSN is not correctly set up. This code works:

Set objDatabase = Server.CreateObject("ADODB.Connection")
objDatabase.Open "DSN=dbname"

where dbname is the System DSN name set up via ODBC Data Sources in Control Panel.

HTH
Pat

-------------------
System 3 2000 Limited
www.system3-2000.co.uk
Reply With Quote
  #4 (permalink)  
Old September 10th, 2003, 04:29 AM
Registered User
 
Join Date: Aug 2003
Location: london, london, United Kingdom.
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to bjtindle
Default

Thanks Pat/Phil

Do I need to have the ODBC/DNS set-up on my system even if I'm trying to connect to a remote host?

If so could you tell me how to do it - I've looked in the control panel and could see nothing that looked obviously to do with ODBC connections. I'm using MS XP Home Edition.

Many thanks
:D

Reply With Quote
  #5 (permalink)  
Old September 10th, 2003, 04:33 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: , , United Kingdom.
Posts: 1,212
Thanks: 0
Thanked 1 Time in 1 Post
Default

In XP its moved from Control Panel to Administrative Tools.

Choose Start > All Programs > Administrative Tools > Data Sources (ODBC)
Reply With Quote
  #6 (permalink)  
Old September 10th, 2003, 04:35 AM
Authorized User
 
Join Date: Jun 2003
Location: , , United Kingdom.
Posts: 21
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Not sure about this but try...
From the start button
Start-->Run
then type in odbcad32.exe and click OK.

Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Data source name not found and no default driver s Durkee VB.NET 2002/2003 Basics 0 September 21st, 2007 01:11 PM
No sutitable Driver found....... programmed Java Databases 2 September 4th, 2007 07:18 AM
Dynamic Data source with Native XML driver Nellie Crystal Reports 1 November 30th, 2006 11:42 AM
err 2580 - data source not found DavidCC SQL Server 2000 4 April 1st, 2004 03:19 PM
Error: Data source name not found and no default d Justine Classic ASP Professional 1 January 23rd, 2004 11:34 AM



All times are GMT -4. The time now is 12:11 AM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.