Ask a Question related to ASP.NET General, Design and Development.
-
vMike #1
Re: ASP.NET and OleDbConnection
Also make sure that aspnet has permissions on the folder and db file
"trevor oakley" <to006e7245@blueyonder.co.uk> wrote in message
news:CMNJa.565$5E.395@news-binary.blueyonder.co.uk...> 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 [url]www.domain.com[/url]
> Database --> cannot be viewed from a browser, to stop hacking
> Logs
>
> All this works with Server.CreateObject in ASP.
>
> Can anyone help?
>
>
>
vMike Guest
-
vMike #2
Re: ASP.NET and OleDbConnection
Try something like this.
path.getpathroot(server.mappath(1)) & the rest of you path to db.
"trevor oakley" <to006e7245@blueyonder.co.uk> wrote in message
news:CMNJa.565$5E.395@news-binary.blueyonder.co.uk...> 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 [url]www.domain.com[/url]
> Database --> cannot be viewed from a browser, to stop hacking
> Logs
>
> All this works with Server.CreateObject in ASP.
>
> Can anyone help?
>
>
>
vMike Guest
-
vMike #3
Re: ASP.NET and OleDbConnection
do a response.write(server.mappath(1) to see the actually root. It is
probably something like
D:\root\hostaway\hostaway.com\..... you should be able to figure it from
there. It all depends on how the server is set up.
"vMike" <Michael.George@nospam.gewarren.com.delete> wrote in message
news:bd9ut2$2b9$1@ngspool-d02.news.aol.com...ASP.NET>
> Try something like this.
>
> path.getpathroot(server.mappath(1)) & the rest of you path to db.
>
> "trevor oakley" <to006e7245@blueyonder.co.uk> wrote in message
> news:CMNJa.565$5E.395@news-binary.blueyonder.co.uk...> > This is a repost, after people said this group is the suitable for>> > 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 [url]www.domain.com[/url]
> > Database --> cannot be viewed from a browser, to stop hacking
> > Logs
> >
> > All this works with Server.CreateObject in ASP.
> >
> > Can anyone help?
> >
> >
> >
>
vMike Guest



Reply With Quote

