|
it
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Newbie Question 2I 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? 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 quoteHide 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? > > > 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 %> 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 quoteHide 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 > %> > > > > > 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) Hello,
Do you have enought permission? IUSR_xxx, IWAM_xxx On Disk, on Folder and on File? With best regards, Show quoteHide 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 > %> > > > > >
GUIDs
Newbie Question Simple CheckBox Question CDO Through IIS or Exchange? search engine safe urls Clasic ASP Connection String sending HUGE file to client via Response.BinaryWrite Dynamically specifying an anchor and name/value pairs Get user details ASP/LDAP/WINNT Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another ER |
|||||||||||||||||||||||