Wrox Programmer Forums
|
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 software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old September 9th, 2003, 04:53 PM
Registered User
 
Join Date: Aug 2003
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

 
Old September 10th, 2003, 02:51 AM
Friend of Wrox
 
Join Date: Jun 2003
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
 
Old September 10th, 2003, 03:29 AM
Authorized User
 
Join Date: Jun 2003
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
 
Old September 10th, 2003, 04:29 AM
Registered User
 
Join Date: Aug 2003
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

 
Old September 10th, 2003, 04:33 AM
Friend of Wrox
 
Join Date: Jun 2003
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)
 
Old September 10th, 2003, 04:35 AM
Authorized User
 
Join Date: Jun 2003
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.






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





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.