Newbie Question 2

Discussion in 'ASP General' started by TenStar, Mar 11, 2005.

  1. TenStar

    TenStar Guest

    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?
     
    TenStar, Mar 11, 2005
    #1
    1. Advertising

  2. 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

    "TenStar" <> wrote in message
    news:%...
    > 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?
    >
    >
    >
     
    Ray Costanzo [MVP], Mar 11, 2005
    #2
    1. Advertising

  3. TenStar

    TenStar Guest

    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
    %>
     
    TenStar, Mar 11, 2005
    #3
  4. 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

    "TenStar" <> wrote in message
    news:...
    > 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
    > %>
    >
    >
    >
    >
    >
     
    Ray Costanzo [MVP], Mar 11, 2005
    #4
  5. TenStar

    Evertjan. Guest

    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)
     
    Evertjan., Mar 11, 2005
    #5
  6. TenStar

    Zam Guest

    Hello,

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

    With best regards,

    "TenStar" <> wrote in message
    news:...
    > 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
    > %>
    >
    >
    >
    >
    >
     
    Zam, Mar 11, 2005
    #6
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jerry C.
    Replies:
    8
    Views:
    248
    Uri Guttman
    Nov 23, 2003
  2. Kruno Saho
    Replies:
    0
    Views:
    145
    Kruno Saho
    Apr 7, 2013
  3. Dave Angel
    Replies:
    0
    Views:
    126
    Dave Angel
    Apr 7, 2013
  4. rusi
    Replies:
    0
    Views:
    114
  5. Miki Tebeka
    Replies:
    0
    Views:
    85
    Miki Tebeka
    Apr 7, 2013
Loading...

Share This Page