Hi
I have made a ASP page that looks at a database and displays the data on a webpage but i cant put the Database on a server it some up with an error saying that the file doesnt exist if i give it a fixed path e.g. f:\home\databases\employees.mdb
How can i edit my code so that it will look to this location ?
here is my code
Code:
<%
pStr = "private, no-cache, must-revalidate"
Response.ExpiresAbsolute = #2000-01-01#
Response.AddHeader "pragma", "no-cache"
Response.AddHeader "cache-control", pStr
%>
<head>
<style>
td { font-size : 8pt; font-family : Verdana, Arial; text-decoration : none; }
body { font-size : 8pt; font-family : Verdana, Arial; text-decoration : none; }
</style>
</head>
<body>
<p align="center"><b>All Records Entered :</b></p>
<table align="center" border=0 cellpadding=3 cellspacing=3 cols=2 width=400>
<%
' Declaring variables
Dim rs, data_source, no
no = 0
data_source = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & _
Server.MapPath("employee.mdb")
' Creating Recordset Object and opening the database
Set rs = Server.CreateObject("ADODB.Recordset")
rs.Open "employees", data_source
' Looping through the records to show all of them
While Not rs.EOF %>
<form action="del.asp" method="post">
<tr>
<td align="right" height=10 valign="top">First Name :</td>
<td align="left" height=10 valign="top" width=250><%=rs("firstname") %></td>
</tr>
<tr>
<td align="right" height=10 valign="top">Sur Name :</td>
<td align="left" height=10 valign="top" width=250><%=rs("surname") %></td>
</tr>
<tr>
<td align="right" height=10 valign="top">Department :</td>
<td align="left" height=10 valign="top" width=250><%=rs("Department") %></td>
</tr>
<tr>
<td align="right" height=10 valign="top">Site :</td>
<td align="left" height=10 valign="top" width=250><%=rs("Site") %></td>
</tr>
<tr>
<td align="right" height=10 valign="top">Ext :</td>
<td align="left" height=10 valign="top" width=250><%=rs("EXT") %></td>
</tr>
<tr>
<td align="right" height=10 valign="top">DDI :</td>
<td align="left" height=10 valign="top" width=250><%=rs("DDI") %></td>
</tr>
<tr>
<td align="right" height=10 valign="top">Mobile :</td>
<td align="left" height=10 valign="top" width=250><%=rs("Mobile") %></td>
</tr>
<tr>
<td align="right" height=10 valign="top">Email :</td>
<td align="left" height=10 valign="top" width=250><%=rs("Email") %></td>
</tr>
<tr>
<td align="right" height=10 valign="top"><input type="hidden" name="id" value="<%=rs("id")%>"></td>
<td align="left" height=10 valign="top" width=250><input type="submit" value="Delete" style="height: 25px; width: 100px"></td>
</tr>
</form>
<tr>
<td align="right" height=10 valign="top"><input type="hidden" name="first_name" value="<%=rs("firstname")%>"></td>
</tr>
<%
no = no + 1
rs.MoveNext
Wend
' Done. Now close the Recordset
rs.Close
Set rs = Nothing
%>
<tr>
<td align="right" height=10 valign="top"><b>Total Records Found</b> :</td>
<td align="left" height=10 valign="top" width=250><%= no %></td>
</tr>
</table>
</body>
</html>
Can anyone help?