Newbie Question 2

T

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?
 
R

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
 
T

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
%>
 
R

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
 
E

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")
 
Z

Zam

Hello,

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

With best regards,
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,262
Messages
2,571,059
Members
48,769
Latest member
Clifft

Latest Threads

Top