Wrox Programmer Forums
| 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 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 February 7th, 2007, 11:14 AM
Registered User
 
Join Date: Sep 2004
Location: , , .
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default Changing from DNS to DNS less connection

Hi,
I'm moving to hosting that doesn't allow DNS connections, as my site has been set up and need therefore to move to a DNS less connection to a MS Access DB.
I'm getting an error reading:

Microsoft OLE DB Provider for ODBC Drivers error '80004005'

[Microsoft][ODBC Microsoft Access Driver]General error Unable to open registry key 'Temporary (volatile) Jet DSN for process 0x80c Thread 0x8c0 DBC 0xec826f4 Jet'.

/showcategory.asp, line 15

The code around this point is:

Code:
Dim rs_Categories
Dim rs_Categories_numRows

Set rs_Categories = Server.CreateObject("ADODB.Recordset")
rs_Categories.ActiveConnection = MM_db_port_STRING
rs_Categories.Source = "SELECT * FROM tbl_Category WHERE CatID = " + Replace(rs_Categories__MMColParam, "'", "''") + ""
rs_Categories.CursorType = 0
rs_Categories.CursorLocation = 2
rs_Categories.LockType = 1
rs_Categories.Open()

rs_Categories_numRows = 0
as created by Dreamweaver... All I've done to try and get around swapping this over is change the file in the Connections file from:
Code:
MM_db_port_STRING = "dsn=databasedsn;"
to:
Code:
Dim MM_db_port_STRING
conString = "DBQ=D:pathtodatabase\databasename.mdb"
MM_db_port_STRING = "DRIVER={Microsoft Access Driver (*.mdb)};" & conString
Any help would be greatly appreciated. I've also tried using Provider= and Data Source instead of the DRIVER= and DBQ but to no avail. Do I need to change the whole Connection part of the code?

Thanks in advance,

Glenn
 
Old February 7th, 2007, 11:19 AM
Wrox Author
Points: 13,255, Level: 49
Points: 13,255, Level: 49 Points: 13,255, Level: 49 Points: 13,255, Level: 49
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2005
Location: Ohio, USA
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

Try: Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\mydatabase.mdb;

And, as a matter of personal prefreance, i suppose, i never hard coded the path to the mdb file.

Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" &Server.MapPath("mydatabase.mdb") &";"

You can also refer to http://www.connectionstrings.com

================================================== =========
I will only tell you how to do it, not do it for you.
Unless, of course, you want to hire me to do work for you.
================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
^^Took that from planoie's profile^^
^^Modified text taken from gbianchi profile^^
================================================== =========
 
Old February 7th, 2007, 11:40 AM
Registered User
 
Join Date: Sep 2004
Location: , , .
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks for that, seems to be seeing the database now, although I'm now getting the interesting error of:

Microsoft JET Database Engine error '80004005'

The Microsoft Jet database engine cannot open the file 'D:\database.mdb'. It is already opened exclusively by another user, or you need permission to view its data.

/showcategory.asp, line 15

Any more thoughts?

Thanks,

Glenn
 
Old February 7th, 2007, 11:49 AM
Registered User
 
Join Date: Sep 2004
Location: , , .
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Sorry all.
The reason for this next error was stupidity on my part. Slightly wrong connection string.

Thanks for the help.

Glenn
 
Old February 7th, 2007, 12:02 PM
Wrox Author
Points: 13,255, Level: 49
Points: 13,255, Level: 49 Points: 13,255, Level: 49 Points: 13,255, Level: 49
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2005
Location: Ohio, USA
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

Glad you got it all worked out.

================================================== =========
I will only tell you how to do it, not do it for you.
Unless, of course, you want to hire me to do work for you.
================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
^^Took that from planoie's profile^^
^^Modified text taken from gbianchi profile^^
================================================== =========




Similar Threads
Thread Thread Starter Forum Replies Last Post
secondary DNS vs. second primary DNS gangu1971 Linux 1 March 1st, 2005 10:40 AM
dns ghari Classic ASP Professional 3 October 27th, 2004 02:12 AM
DNS-less ODBC php Morrislgn Beginning PHP 0 September 9th, 2004 02:59 AM
DNS kilika Classic ASP Professional 5 August 4th, 2004 12:53 PM
DNS Configuration anibiswas Linux 1 December 10th, 2003 01:13 PM





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