Home All Groups Group Topic Archive Search About


Author
11 Mar 2005 6:08 PM
TenStar
I have my Access Database with one table, the table is a link to a text file
on one of my servers.  Can this be accessed using my webserver via ASP?

Author
11 Mar 2005 7:26 PM
Ray Costanzo [MVP]
Have you tried it?

<%
Dim oADO, oRS
set oADO = createobject("ADODB.Connection")
oADO.Open  "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" &
Server.MapPath("test.mdb")

Set oRS = oADO.Execute("SELECT * From [LinkedTable]")
If Not oRS.EOF Then
Do while not ors.eof
  Response.Write oRS.Fields.Item(0).Value & "<br>"
oRS.Movenext
Loop
End If
oRS.Close : Set oRS = Nothing
oADO.Close : Set oADO = Nothing
%>

Ray at work

Show quote
"TenStar" <tens***@yahoo.com> wrote in message
news:%23fUmZVmJFHA.508@TK2MSFTNGP12.phx.gbl...
> I have my Access Database with one table, the table is a link to a text
file
> on one of my servers.  Can this be accessed using my webserver via ASP?
>
>
>
Author
11 Mar 2005 8:34 PM
TenStar
I had something close to that.  I adopted your code.

Microsoft JET Database Engine (0x80004005)
'Z:\Database' is not a valid path. Make sure that the path name is spelled
correctly and that you are connected to the server on which the file
resides.
/sysinfo.asp, line 17

Why is it pulling from the Z drive?


<%
Dim oADO, oRS
set oADO = CreateObject("ADODB.Connection")

oADO.Open  "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" &
server.mapPath("\database\sa inventory.mdb")

Set oRS = oADO.Execute("SELECT * From SystemInfo")
If Not oRS.EOF Then
Do while not ors.eof
  Response.Write oRS.Fields.Item(0).Value & "<br>"
  Response.Write oRS.Fields.Item(1).Value & "<br>"
  Response.Write oRS.Fields.Item(2).Value & "<br>"
  Response.Write oRS.Fields.Item(3).Value & "<br>"
  Response.Write oRS.Fields.Item(4).Value & "<br>"
oRS.Movenext
Loop
End If
oRS.Close : Set oRS = Nothing
oADO.Close : Set oADO = Nothing
%>
Author
11 Mar 2005 8:39 PM
Ray Costanzo [MVP]
Is your site on a Z drive or something?  In relation to the ASP file with
this code, where is the mdb file physically located on the file system?

Try:

Server.MapPath("/database/sa inventory.mdb")

Ray at work

Show quote
"TenStar" <tens***@yahoo.com> wrote in message
news:OtgrumnJFHA.2736@TK2MSFTNGP09.phx.gbl...
> I had something close to that.  I adopted your code.
>
> Microsoft JET Database Engine (0x80004005)
> 'Z:\Database' is not a valid path. Make sure that the path name is spelled
> correctly and that you are connected to the server on which the file
> resides.
> /sysinfo.asp, line 17
>
> Why is it pulling from the Z drive?
>
>
> <%
> Dim oADO, oRS
> set oADO = CreateObject("ADODB.Connection")
>
> oADO.Open  "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" &
> server.mapPath("\database\sa inventory.mdb")
>
> Set oRS = oADO.Execute("SELECT * From SystemInfo")
> If Not oRS.EOF Then
>  Do while not ors.eof
>   Response.Write oRS.Fields.Item(0).Value & "<br>"
>   Response.Write oRS.Fields.Item(1).Value & "<br>"
>   Response.Write oRS.Fields.Item(2).Value & "<br>"
>   Response.Write oRS.Fields.Item(3).Value & "<br>"
>   Response.Write oRS.Fields.Item(4).Value & "<br>"
>  oRS.Movenext
>  Loop
> End If
> oRS.Close : Set oRS = Nothing
> oADO.Close : Set oADO = Nothing
> %>
>
>
>
>
>
Author
11 Mar 2005 8:52 PM
Evertjan.
TenStar wrote on 11 mrt 2005 in microsoft.public.inetserver.asp.general:
> server.mapPath("\database\sa inventory.mdb")

I suspect it is not your problem,
but the parameter of mappath is a web type adress:

abs-dos/windows-addr = server.mapPath("/database/sa inventory.mdb")

--
Evertjan.
The Netherlands.
(Replace all crosses with dots in my emailaddress)
Author
11 Mar 2005 9:51 PM
Zam
Hello,

Do you have enought permission? IUSR_xxx, IWAM_xxx On Disk, on Folder and on
File?

With best regards,

Show quote
"TenStar" <tens***@yahoo.com> wrote in message
news:OtgrumnJFHA.2736@TK2MSFTNGP09.phx.gbl...
> I had something close to that.  I adopted your code.
>
> Microsoft JET Database Engine (0x80004005)
> 'Z:\Database' is not a valid path. Make sure that the path name is spelled
> correctly and that you are connected to the server on which the file
> resides.
> /sysinfo.asp, line 17
>
> Why is it pulling from the Z drive?
>
>
> <%
> Dim oADO, oRS
> set oADO = CreateObject("ADODB.Connection")
>
> oADO.Open  "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" &
> server.mapPath("\database\sa inventory.mdb")
>
> Set oRS = oADO.Execute("SELECT * From SystemInfo")
> If Not oRS.EOF Then
>  Do while not ors.eof
>   Response.Write oRS.Fields.Item(0).Value & "<br>"
>   Response.Write oRS.Fields.Item(1).Value & "<br>"
>   Response.Write oRS.Fields.Item(2).Value & "<br>"
>   Response.Write oRS.Fields.Item(3).Value & "<br>"
>   Response.Write oRS.Fields.Item(4).Value & "<br>"
>  oRS.Movenext
>  Loop
> End If
> oRS.Close : Set oRS = Nothing
> oADO.Close : Set oADO = Nothing
> %>
>
>
>
>
>

AddThis Social Bookmark Button