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 24th, 2005, 07:59 AM
Registered User
 
Join Date: Feb 2005
Location: , , .
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default Connection string and file include trouble

I am having a problem with including files into some ASP pages. Even when the file is in the same directory as the .asp page, it gives me a missing file error.

Server is IIS 5.1 with Scripts enabled.

Example include code that isn't working:
<!--METADATA TYPE="typelib"
             FILE="msado15.dll" -->

or





I believe another problem I am having has to do with the same problem. I am getting an error on trying to connect with a database (Access 2000). It is secured with user level security and currently the db file and the extra security file are both in the same folder.

here is the code from the file 'dbConnect.asp'
<%
Dim objConn
Set objConn = Server.CreateObject("ADODB.Connection")

' Get username and password
if (Session("sUsername") = "") or (Session("sPassword") = "") then
    response.Redirect "Default.asp"
endif

objConn.Open "Provider = Microsoft.Jet.OLEDB.4.0; Data Source = G3TrainingDB_2005.mdb", Session("sUsername"), Session("sPassowrd")
%>

Any advice on this would be greatly appreciated.

John Cramer
Sgt&nbsp;&nbsp;&nbsp;&nbsp;USMC
 
Old February 24th, 2005, 08:36 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: Harrisburg, PA, USA.
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts
Default

For the datasource, you have to specify the full path to the .mdb file. For the include file, is this file in the same directory as that file? You could try include virtual="~/path/dbconnect.asp", if your app is setup as a virtual.

Brian
 
Old February 26th, 2005, 04:46 AM
Registered User
 
Join Date: Feb 2005
Location: , , .
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thank you for the help! Using the full physical path helped conecting to the database and also the METADATA include. It still didn't seem to find the file when I used the virtual path, but maybe there is something configured different on my web server.

I am still having trouble with the '#include' line, but I have a couple workarounds I'm going to try with that. All I want that for is to write write snippets that will be used on several pages.

A web site that helped me with my last problem of connecting to a db with userlevel security was www.connectionstrings.com
They have example connection strings for a ton of databases and for each one it has most if not all of the possible different configuarations. A VERY handy website.

John Cramer
Sgt&nbsp;&nbsp;&nbsp;&nbsp;USMC




Similar Threads
Thread Thread Starter Forum Replies Last Post
Connection String with Excel file mateenmohd Classic ASP Databases 8 January 25th, 2013 02:49 AM
Access Connection String Trouble mat41 Classic ASP Basics 12 June 29th, 2008 07:53 PM
Include file trouble rstelma ASP.NET 1.0 and 1.1 Professional 3 February 12th, 2008 01:21 PM
setup database connection include file in PHP crmpicco PHP Databases 2 September 30th, 2007 04:18 PM
difference between include file & include virtual crmpicco Classic ASP Basics 2 January 23rd, 2006 11:50 AM





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