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 March 23rd, 2007, 10:13 AM
Friend of Wrox
Join Date: Apr 2006
Posts: 160
Thanks: 0
Thanked 0 Times in 0 Posts
Default how to connect to MDF sql server database?


I try to access within an classic ASP page an MDF file (newres.mdf) of sql server express 2005 database which is located in
I get following error :

Provider error '80040e21'
Multiple-step OLE DB operation generated errors. Check each OLE DB
status value, if available. No work was done"

The code in ASP file:
set objdc = Server.CreateObject("ADODB.Connection")
objdc.Open(application("newres")) 'error line

Sub Application_OnStart
Application("newres") =
"Provider=SQLOLEDB;DATABASE=c:\inetpub\wwwroot\res krosql\App_Data\newres.mdf;Data
Source=.\SQLEXPRESS;AttachDbFilename=c:\inetpub\ww wroot\reskrosql\App_Data\newres.mdf;Integrated
Security=True;User Instance=True"

'i also tried this:
Sub Application_OnStart
Application("newres") = "Provider=SQLOLEDB;DATABASE=newres;Data
Source=.\SQLEXPRESS;AttachDbFilename=c:\inetpub\ww wroot\reskrosql\App_Data\newres.mdf;Integrated
Security=True;User Instance=True"

End Sub

Thanks for help

Old March 25th, 2007, 02:02 AM
Authorized User
Join Date: Aug 2004
Posts: 22
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to bishnupokhrel Send a message via Yahoo to bishnupokhrel

Hi hertendreef,

The feature AttachDbFilename is supported by ADO.Net 2.0 .

I am not sure if this is supported by classic ADO.
May be this is the reason you got the error.

Bishnu Pokharel
[email protected]

Similar Threads
Thread Thread Starter Forum Replies Last Post
Chpt 3 - Connect to SQL Server 2000 Database BennyHill BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6 6 June 7th, 2007 03:30 PM
VB 2005 connect to server 2003 with SQL database Derek_05 Visual Basic 2005 Basics 3 September 20th, 2006 10:10 AM
Connecting to project MDF SQL Database File nsoivan Crystal Reports 0 July 31st, 2006 05:14 AM
Connect Jsp Page To Sql Server Database jayul_p3nt JSP Basics 1 January 22nd, 2006 10:17 AM
How to connect to sql server database usng jdbc? method Java Databases 1 April 13th, 2005 09:23 PM

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