how to access MDF file with ASP classic?



Hi,

i have already posted this problem in an ASP newsgroup without succes, so i
try here.

I try to access within an cliassic ASP page an MDF file (newres.mdf) of sql
server express 2005 database which is located in
c:\inetpub\wwwroot\reskrosql\App_Data.
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
%>

global.asa:
----------
Sub Application_OnStart
Application("newres") =
"Provider=SQLOLEDB;DATABASE=c:\inetpub\wwwroot\reskrosql\App_Data\newres.mdf;Data
Source=.\SQLEXPRESS;AttachDbFilename=c:\inetpub\wwwroot\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\wwwroot\reskrosql\App_Data\newres.mdf;Integrated
Security=True;User Instance=True"

End Sub

Thanks for help
Bart



.



Relevant Pages

  • Re: Wscript within VBA
    ... It posts a form to an ASP page, ... Since what you want to do sounds like it will require admin privileges, ... server to impersonate an admin account. ... >> Exit Sub ...
    (microsoft.public.vb.database)
  • Procedures dont have access to public Variables in ASP
    ... The problem is when running in ASP ... my .vbs file which is on the server using wscript or cscript all is fine. ... The only difference is the QuitOnError() procedure. ... sub SendEmail ...
    (microsoft.public.scripting.vbscript)
  • Re: Redirecting web pages
    ... processor only processes ASP code if the extension is .asp. ... since they are included in .asp files, are not required to be .asp files so ... Response.Writeend sub ...
    (microsoft.public.scripting.vbscript)
  • Re: saving current asp to server
    ... there isn't any functionality in ASP like: ... Response.Writing the .ResponseText, write the ResponseText into a file. ... > I got a very nice reply back from Scott McNair. ... > Sub Write ...
    (microsoft.public.inetserver.asp.general)
  • Re: FileSystemObject-Invalid procedure call or arg
    ... When running the code via the .vbs file it breaks at about 1.5 Mb. ... In fact I have created files roughly 5Mb in size no problem from .asp. ... > Dim sStuffing ... >> End Sub ...
    (microsoft.public.scripting.vbscript)