Re: ASP.NET and OleDbConnection

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance




Hi

instead of
dbStr = Server.MapPath("../TestDatabase.mdb")

use

dbStr = Server.MapPath("\TestDatabase.mdb")

if your mdb file is directly under wwwroot then it should be \*.mdb
file or else it should be

\foldername\*.mdb, plz try this

rgds

Rajesh
vMike Wrote:
> Try something like this.
>
> path.getpathroot(server.mappath(1)) & the rest of you path to db.
>
> "trevor oakley" <to006e7245@xxxxxxxxxxxxxxxx> wrote in message
> news:CMNJa.565$5E.395@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
> > This is a repost, after people said this group is the suitable for
> ASP.NET
> > comments.
> >
> >
> > I am working through Teach Yourself ASP.NET in 21 Days (Day10), and
> I
> > have hit a problem with OleDbConnection. Maybe someone here knows a
> > lot of connections to databases in ASP.NET, and is willing to share
> > their knowledge.
> >
> > I am trying
> >
> > dbStr = Server.MapPath("../TestDatabase.mdb")
> > Response.write("db string " & dbStr)
> >
> > objConnection = New
> > OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;" _
> > & " Data Source=" & dbStr & ";")
> >
> > but it fails, with an error on the path (cannot exit above top
> > directory).
> >
> > The actual databases at hostway.com are stored above www so that
> they
> > cannot be hacked using a browser. But the path seems to expect the
> > root directory as seen by the browser. It works it I take out the
> ../
> > and move my database to the www directory.
> >
> > Directory structure seen at FTP logon
> >
> > www --> alias to browser accessible pages, eg www.domain.com
> > Database --> cannot be viewed from a browser, to stop hacking
> > Logs
> >
> > All this works with Server.CreateObject in ASP.
> >
> > Can anyone help?
> >
> >
> >


--
rajeshseetharam
------------------------------------------------------------------------
rajeshseetharam's Profile: http://www.hightechtalks.com/member.php?userid=8
View this thread: http://www.hightechtalks.com/showthread.php?t=92982

.



Relevant Pages

  • Re: How can I transfer Access records from one computer to another?
    ... You don't need to "copy the records" - simply use Windows Explorer to ... copy the .mdb files which constitute your database (or databases). ... Access2003 can read and use A2000 format databases; ... The only "gotcha" I can think of is that if you copy your .mdb file to ...
    (microsoft.public.access.gettingstarted)
  • Re: Import/Export Data from ACC 97 to ACC 2000
    ... If you have split the databases, so there's a back end MDB file ... >into ACC 2K. ... >in the new version BUT we cannot perform new queries on the data, ...
    (microsoft.public.access.externaldata)
  • Re: LEFT JOIN problem
    ... You will not be able to perform a sql join between them given that ... they are in different databases, unless one of the databases has a link ... Jet allows the use of the full path to the mdb file along with the ... Select ProductID, SUMAs EEE From ...
    (microsoft.public.inetserver.asp.general)
  • Re: Access 2003 runtime and Office 97 living together
    ... >only fire up when using the databases I develop. ... But of course you can have a shortcut on the desktop that opens the proper ... Open Either Version From Windows Explorer ... Then if you right click on an .mdb file in Windows Explorer you will have the ...
    (microsoft.public.access.gettingstarted)
  • Enabling Users to Download MDB or XLS File (then save or view)
    ... The data they need exists in a SQL Server database: the XLS or MDB file does ... then send that new file down to the browser. ...
    (microsoft.public.dotnet.framework.aspnet)