Greg
08-31-2004, 06:20 AM
The following page stopped working when I had to stop using the mappath connection line any suggesting from anybody? I had to stop using mappath connection because we went to a paid server from using a free server.
I need to use something like Data Source=\\premfs15\sites\Premium15\troop230\database\track.mdb"%> Now mind you, I got this code maybe a few years ago from
Abakada and it worked good with the mappath connection line, also beaware that its using
a include file......If you have a better way i am willing to change the whole code, but I am not that good at asp :smack: so any help you give me you gonna have to almost draw me a picture like give me the code line for line, I would be very appreciated if someone could help me get a page like this going again....thanks in advance for anyone looking at this.
<%@ language="VBScript" %>
<!-- #include file="adovbs.inc" -->
<html>
<head>
<title>Scout Lists</title>
<!-- ©2000 Abakada Web WorkShop; Author: Rey V. Nuñez -->
<link href="tutor.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
select {width:125}
-->
</style>
<% 'specify the provider
'strProvider="driver={Microsoft Access Driver (*.mdb)};DBQ=" & Server.MapPath("\troop230\db\scout.mdb") & ";"
'create and open a connection
set dbConn = Server.CreateObject("ADODB.Connection")
'dbConn.Open strProvider
dbConn.Open "Provider=Microsoft.Jet.OLEDB.4.0;"_
& "Data Source=\\premfs15\sites\Premium15\troop230\database\track.mdb"%>
</head>
<body bgcolor ="#009999">
<div align="center">
<h3>Pick a Scout</h3>
<% rowCount=0
'create and open the products recordset
strQuery = "SELECT fname, rank, patrol, position, work FROM scout"
set rsProds=Server.CreateObject("ADODB.Recordset")
rsProds.Open strQuery, dbConn, , , adCmdText
'define the options query
strSQL="SELECT DISTINCT fname FROM scout"
'create and open the options recordset
set rsType=Server.CreateObject("ADODB.Recordset")
rsType.Open strSQL, dbConn, , , adCmdText %>
<form method="post">
Choose A Group <select name="fname">
<% do until rsType.EOF %>
<option><%= rsType("fname")%>
<% rsType.MoveNext
loop
'close options recset and flush from memory
rsType.Close
set rsType = Nothing %>
</select> <input type="submit" value="Show me">
</form>
<% if not isEmpty(Request("fname")) then
strType=Request("fname") %>
<h5>. . . retrieving <%= strType %> records for your question</h5>
<% 'filter the products query
rsProds.Filter = "fname = '" & strType & "'" %>
<table width=90% cellspacing=1 cellpadding=5 border=0>
<!-- begin column headers for Products table -->
<tr>
<th>Scout</th>
<th>Rank</th>
<th>Patrol</th>
<th>Position</th>
<th>Work</th></tr>
<% 'cycle thru the record set and display each row results
do until rsProds.EOF %>
<tr>
<td align="right"><%= rsProds("fname")%></td>
<td align="right"><%= rsProds("rank")%></td>
<td align="right"><%= rsProds("patrol")%></td>
<td align="right"><%= rsProds("position")%></td>
<td align="right"><%= rsProds("work")%></td></tr>
<!-- next Row = next Record -->
<% rowCount = rowCount+1
'increment record position with MoveNext method
rsProds.MoveNext
loop
'close connection and flush objects from memory
dbConn.Close
set dbConn = Nothing
set rsProds = Nothing %>
</table>
<% end if %>
</div>
<br>
<br>
<br>
</center>
<style type="text/css">
<!--
.Navlink {COLOR: #Black; TEXT-DECORATION: none; font-family: arial; font-size: 12pt; font-weight: bold;}
a:link.Navlink {color : Black;}
a:visited.Navlink {color : Black;}
a:active.Navlink {text-decoration: none;}
a:hover.Navlink {text-decoration: none;}
-->
</style>
<script language = "javascript">
<!--
function LmOver(elem, clr)
{elem.style.backgroundColor = clr;
elem.children.tags('A')[0].style.color = "#FFFFFF";
elem.style.cursor = 'hand'}
function LmOut(elem, clr)
{elem.style.backgroundColor = clr;
elem.children.tags('A')[0].style.color = "Black";}
function LmDown(elem, clr)
{elem.style.backgroundColor = clr;
elem.children.tags('A')[0].style.color = "#FFFFFF";}
function LmUp(path)
{location.href = path;}
//-->
</script>
<table border="0" width="70" bgcolor="#000000" cellspacing="0" cellpadding="0">
<tr><td width="100%">
<table border="0" width="100%" cellspacing="1" cellpadding="1">
<tr><td width="100%" onMouseover="LmOver(this, 'Black')" onMouseout="LmOut(this, '#FFFFFF')" onMouseDown="LmDown(this, 'Black')"
onMouseUp="LmUp('troop230.html')" bgcolor="#FFFFFF"><A HREF="http://www.troop-230.org" Class="navlink"> HOME</a></td></tr>
</table>
</td></tr>
</table>
<a href="http://www.guistuff.com/"><img border="0" src="http://www.guistuff.com/images/11dot.gif" width="1" height="1"></a>
</center>
</body>
</html>
I need to use something like Data Source=\\premfs15\sites\Premium15\troop230\database\track.mdb"%> Now mind you, I got this code maybe a few years ago from
Abakada and it worked good with the mappath connection line, also beaware that its using
a include file......If you have a better way i am willing to change the whole code, but I am not that good at asp :smack: so any help you give me you gonna have to almost draw me a picture like give me the code line for line, I would be very appreciated if someone could help me get a page like this going again....thanks in advance for anyone looking at this.
<%@ language="VBScript" %>
<!-- #include file="adovbs.inc" -->
<html>
<head>
<title>Scout Lists</title>
<!-- ©2000 Abakada Web WorkShop; Author: Rey V. Nuñez -->
<link href="tutor.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
select {width:125}
-->
</style>
<% 'specify the provider
'strProvider="driver={Microsoft Access Driver (*.mdb)};DBQ=" & Server.MapPath("\troop230\db\scout.mdb") & ";"
'create and open a connection
set dbConn = Server.CreateObject("ADODB.Connection")
'dbConn.Open strProvider
dbConn.Open "Provider=Microsoft.Jet.OLEDB.4.0;"_
& "Data Source=\\premfs15\sites\Premium15\troop230\database\track.mdb"%>
</head>
<body bgcolor ="#009999">
<div align="center">
<h3>Pick a Scout</h3>
<% rowCount=0
'create and open the products recordset
strQuery = "SELECT fname, rank, patrol, position, work FROM scout"
set rsProds=Server.CreateObject("ADODB.Recordset")
rsProds.Open strQuery, dbConn, , , adCmdText
'define the options query
strSQL="SELECT DISTINCT fname FROM scout"
'create and open the options recordset
set rsType=Server.CreateObject("ADODB.Recordset")
rsType.Open strSQL, dbConn, , , adCmdText %>
<form method="post">
Choose A Group <select name="fname">
<% do until rsType.EOF %>
<option><%= rsType("fname")%>
<% rsType.MoveNext
loop
'close options recset and flush from memory
rsType.Close
set rsType = Nothing %>
</select> <input type="submit" value="Show me">
</form>
<% if not isEmpty(Request("fname")) then
strType=Request("fname") %>
<h5>. . . retrieving <%= strType %> records for your question</h5>
<% 'filter the products query
rsProds.Filter = "fname = '" & strType & "'" %>
<table width=90% cellspacing=1 cellpadding=5 border=0>
<!-- begin column headers for Products table -->
<tr>
<th>Scout</th>
<th>Rank</th>
<th>Patrol</th>
<th>Position</th>
<th>Work</th></tr>
<% 'cycle thru the record set and display each row results
do until rsProds.EOF %>
<tr>
<td align="right"><%= rsProds("fname")%></td>
<td align="right"><%= rsProds("rank")%></td>
<td align="right"><%= rsProds("patrol")%></td>
<td align="right"><%= rsProds("position")%></td>
<td align="right"><%= rsProds("work")%></td></tr>
<!-- next Row = next Record -->
<% rowCount = rowCount+1
'increment record position with MoveNext method
rsProds.MoveNext
loop
'close connection and flush objects from memory
dbConn.Close
set dbConn = Nothing
set rsProds = Nothing %>
</table>
<% end if %>
</div>
<br>
<br>
<br>
</center>
<style type="text/css">
<!--
.Navlink {COLOR: #Black; TEXT-DECORATION: none; font-family: arial; font-size: 12pt; font-weight: bold;}
a:link.Navlink {color : Black;}
a:visited.Navlink {color : Black;}
a:active.Navlink {text-decoration: none;}
a:hover.Navlink {text-decoration: none;}
-->
</style>
<script language = "javascript">
<!--
function LmOver(elem, clr)
{elem.style.backgroundColor = clr;
elem.children.tags('A')[0].style.color = "#FFFFFF";
elem.style.cursor = 'hand'}
function LmOut(elem, clr)
{elem.style.backgroundColor = clr;
elem.children.tags('A')[0].style.color = "Black";}
function LmDown(elem, clr)
{elem.style.backgroundColor = clr;
elem.children.tags('A')[0].style.color = "#FFFFFF";}
function LmUp(path)
{location.href = path;}
//-->
</script>
<table border="0" width="70" bgcolor="#000000" cellspacing="0" cellpadding="0">
<tr><td width="100%">
<table border="0" width="100%" cellspacing="1" cellpadding="1">
<tr><td width="100%" onMouseover="LmOver(this, 'Black')" onMouseout="LmOut(this, '#FFFFFF')" onMouseDown="LmDown(this, 'Black')"
onMouseUp="LmUp('troop230.html')" bgcolor="#FFFFFF"><A HREF="http://www.troop-230.org" Class="navlink"> HOME</a></td></tr>
</table>
</td></tr>
</table>
<a href="http://www.guistuff.com/"><img border="0" src="http://www.guistuff.com/images/11dot.gif" width="1" height="1"></a>
</center>
</body>
</html>