Post or Display Data from an External Access database (Full Version)

All Forums >> [Web Development] >> ASP and Database



Message


autumn1978 -> Post or Display Data from an External Access database (3/13/2008 21:16:57)

I need to display database results from an external database using custom ASP. Not sure what the connection string should be. The following code works in the same web where the database is located, but doesn't work on my other web site. I don't have a dedicated server. Can you help?


<body>
<table>
<%
set conn=Server.CreateObject("ADODB.Connection")
conn.Provider="Microsoft.Jet.OLEDB.4.0"
conn.Open Server.MapPath("/fpdb/mydb.mdb")

set rs=Server.CreateObject("ADODB.recordset")

rs.open "SELECT * FROM tbl_postback",conn
do until rs.eof
Response.Write "<tr>" & "<td>" & (rs("campname")) & "</td>" & "</tr>"
rs.movenext
loop
%>
</table>




rdouglass -> RE: Post or Display Data from an External Access database (3/13/2008 21:39:36)

quote:

database results from an external database using custom ASP.


Can you describe "external" a little better? Do you mean a network share or something like that?

You can do something like this:

conn.open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=Z:\myshare\webbase.mdb"

or something to that effect. It doesnt have to use the mapppath command.

That help any?





Page: [1]

Valid CSS!




Forum Software © ASPPlayground.NET Advanced Edition 2.4.5 ANSI
6.201172E-02