Ok, I'm very new to asp, but this is what I'm trying to accomplish. I want to have a selection drop down list where the user can select a database to load. When they select the database, I want that value to then populate the asp variable named "database". I was hoping I could pass this using javascript, but I don't think I can because asp is server side and javascript is client side.
Any help would be appreciated!
[code=html]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>OpenLi nk Monitor</title>
<link rel="stylesheet " type="text/css" href="./css/style.css" />
<script>
<!--
/*
Auto Refresh Page with Time script
By JavaScript Kit (javascriptkit. com)
Over 200+ free scripts here!
*/
//enter refresh time in "minutes:second s" Minutes should range from 0 to inifinity. Seconds should range from 0 to 59
var limit="0:90"
if (document.image s){
var parselimit=limi t.split(":")
parselimit=pars elimit[0]*60+parselimit[1]*1
}
function beginrefresh(){
if (!document.imag es)
return
if (parselimit==1)
window.location .reload()
else{
parselimit-=1
curmin=Math.flo or(parselimit/60)
cursec=parselim it%60
if (curmin!=0)
curtime=curmin+ " minutes and "+cursec+" seconds left until page refresh!"
else
curtime=cursec+ " seconds left until page refresh!"
window.status=c urtime
setTimeout("beg inrefresh()",10 00)
}
}
window.onload=b eginrefresh
function changeDb(db_sel ){
alert(db_sel.va lue)
}
//-->
</script>
<!---adoCon.Open "Provider=Micro soft.Jet.OLEDB. 4.0; Data Source=
adoCon.Open "Provider=Micro soft.Jet.OLEDB. 4.0; Data Source=" & Server.MapPath( "oplmodel.m db")
strSQL = "SELECT Interface.Name, Interface.Full_ name FROM INTERFACE;"
response.write( Server.MapPath( "opl_monitor.as p"))
--->
<style type="text/css">
<!--
.style2 {font-size: small}
-->
</style>
</head>
<body>
<%
Dim adoCon
Dim OpenLink
Dim strSQL
Dim database
Set adoCon = Server.CreateOb ject("ADODB.Con nection")
database="\\grp b\grpb\23040003 \Data\OPLT23040 003B_TEST2_SFC1 .mdb"
adoCon.Open "Provider=Micro soft.Jet.OLEDB. 4.0; Data Source=" & database
Set OpenLink = Server.CreateOb ject("ADODB.Rec ordset")
strSQL = "Select ASSOCIATION.ASS OC_NAME,Interfa ce.Full_Name from ASSOCIATION inner join interface on association.ass oc_name=interfa ce.name where ASSOCIATION.NAM E='OPLENG'"
getIPInfo = "Select API_LISTEN,ALER T_LISTEN from ENGINE"
set opls = CreateObject("S MSOPENLINK.SMSO PENLinkSession. 1")
set oplc = CreateObject("S MSOPENLINK.SMSO PENLinkControl. 1")
OpenLink.Open getIPInfo, adoCon
opls.ServerPort = OpenLink("API_L ISTEN")
opls.AlertPort= OpenLink("ALERT _LISTEN")
opls.MachineNam e = "GRPB"
opls.OpenPath 3, "OPL_USER"
retstatus = server.HTMLEnco de(opls.LastSta tus)
OpenLink.Close
OpenLink.Open strSQL, adoCon
%>
<h3>OpenLink Monitor v0.1</h3>
<h5>Open Path Return Status: <%=Server.HTMLE ncode(retstatus )%></h5>
<center>
<span class="style2"> Please select the design to monitor:</span>
<select name="sel_db" OnChange="chang eDb(this);retur n false;">
<option value="\\grpb\g rpb\23040003\Da ta\OPLT2340_Ins truments_B.MDB" >TEST - Instruments</option>
<option value="\\grpb\g rpb\23040003\Da ta\OPLT23040003 B_TEST2_SFC1.md b">TEST - FTP</option>
<option value="\\grpb\g rpb\23040003\Da ta\oplt2340_FTP _B.mdb">TEST - Main</option>
</select>
</center>
<br />
<table cellspacing=0 align="center">
<tr>
<th>Interface </th>
<th>Description </th>
<th>Status</th>
</tr>
<%
Do While not OpenLink.EOF
status_text = oplc.StatusInte rface(opls,Open Link("ASSOC_NAM E"))
Response.Write( "<tr>")
Response.Write( "<td>" & OpenLink("ASSOC _NAME") & "</td>")
Dim myNum
Dim int_desc
Dim desc_length
Dim int_status
myNum = 5
int_desc = OpenLink("FULL_ NAME")
desc_length=len (int_desc)
If desc_length >0 Then
Response.Write( "<td>" & int_desc & "</td>")
Else
Response.Write( "<td><i>No Description entered in design</i></td>")
End If
int_status = InStr(status_te xt, "ACTIVE")
If int_status = 0 then
Response.Write( "<td><b><fo nt color=#FF0000>" & status_text & "</font></b></td>")
Else
Response.Write( "<td>" & status_text & "</td>")
End If
Response.Write( "</tr>")
OpenLink.MoveNe xt
Loop
OpenLink.Close
Set OpenLink = Nothing
Set adoCon = Nothing
%>
</table>
<!---
<%
set opls = CreateObject("S MSOPENLINK.SMSO PENLinkSession. 1")
set oplc = CreateObject("S MSOPENLINK.SMSO PENLinkControl. 1")
opls.ServerPort = "9027"
opls.AlertPort= "9028"
opls.MachineNam e = "10.145.34. 14"
opls.OpenPath 3, "OPL_USER"
retstatus = server.HTMLEnco de(opls.LastSta tus)
%>
--->
<!--- Server number = 3 --->
</body>
</html>
[/code]
Any help would be appreciated!
[code=html]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>OpenLi nk Monitor</title>
<link rel="stylesheet " type="text/css" href="./css/style.css" />
<script>
<!--
/*
Auto Refresh Page with Time script
By JavaScript Kit (javascriptkit. com)
Over 200+ free scripts here!
*/
//enter refresh time in "minutes:second s" Minutes should range from 0 to inifinity. Seconds should range from 0 to 59
var limit="0:90"
if (document.image s){
var parselimit=limi t.split(":")
parselimit=pars elimit[0]*60+parselimit[1]*1
}
function beginrefresh(){
if (!document.imag es)
return
if (parselimit==1)
window.location .reload()
else{
parselimit-=1
curmin=Math.flo or(parselimit/60)
cursec=parselim it%60
if (curmin!=0)
curtime=curmin+ " minutes and "+cursec+" seconds left until page refresh!"
else
curtime=cursec+ " seconds left until page refresh!"
window.status=c urtime
setTimeout("beg inrefresh()",10 00)
}
}
window.onload=b eginrefresh
function changeDb(db_sel ){
alert(db_sel.va lue)
}
//-->
</script>
<!---adoCon.Open "Provider=Micro soft.Jet.OLEDB. 4.0; Data Source=
adoCon.Open "Provider=Micro soft.Jet.OLEDB. 4.0; Data Source=" & Server.MapPath( "oplmodel.m db")
strSQL = "SELECT Interface.Name, Interface.Full_ name FROM INTERFACE;"
response.write( Server.MapPath( "opl_monitor.as p"))
--->
<style type="text/css">
<!--
.style2 {font-size: small}
-->
</style>
</head>
<body>
<%
Dim adoCon
Dim OpenLink
Dim strSQL
Dim database
Set adoCon = Server.CreateOb ject("ADODB.Con nection")
database="\\grp b\grpb\23040003 \Data\OPLT23040 003B_TEST2_SFC1 .mdb"
adoCon.Open "Provider=Micro soft.Jet.OLEDB. 4.0; Data Source=" & database
Set OpenLink = Server.CreateOb ject("ADODB.Rec ordset")
strSQL = "Select ASSOCIATION.ASS OC_NAME,Interfa ce.Full_Name from ASSOCIATION inner join interface on association.ass oc_name=interfa ce.name where ASSOCIATION.NAM E='OPLENG'"
getIPInfo = "Select API_LISTEN,ALER T_LISTEN from ENGINE"
set opls = CreateObject("S MSOPENLINK.SMSO PENLinkSession. 1")
set oplc = CreateObject("S MSOPENLINK.SMSO PENLinkControl. 1")
OpenLink.Open getIPInfo, adoCon
opls.ServerPort = OpenLink("API_L ISTEN")
opls.AlertPort= OpenLink("ALERT _LISTEN")
opls.MachineNam e = "GRPB"
opls.OpenPath 3, "OPL_USER"
retstatus = server.HTMLEnco de(opls.LastSta tus)
OpenLink.Close
OpenLink.Open strSQL, adoCon
%>
<h3>OpenLink Monitor v0.1</h3>
<h5>Open Path Return Status: <%=Server.HTMLE ncode(retstatus )%></h5>
<center>
<span class="style2"> Please select the design to monitor:</span>
<select name="sel_db" OnChange="chang eDb(this);retur n false;">
<option value="\\grpb\g rpb\23040003\Da ta\OPLT2340_Ins truments_B.MDB" >TEST - Instruments</option>
<option value="\\grpb\g rpb\23040003\Da ta\OPLT23040003 B_TEST2_SFC1.md b">TEST - FTP</option>
<option value="\\grpb\g rpb\23040003\Da ta\oplt2340_FTP _B.mdb">TEST - Main</option>
</select>
</center>
<br />
<table cellspacing=0 align="center">
<tr>
<th>Interface </th>
<th>Description </th>
<th>Status</th>
</tr>
<%
Do While not OpenLink.EOF
status_text = oplc.StatusInte rface(opls,Open Link("ASSOC_NAM E"))
Response.Write( "<tr>")
Response.Write( "<td>" & OpenLink("ASSOC _NAME") & "</td>")
Dim myNum
Dim int_desc
Dim desc_length
Dim int_status
myNum = 5
int_desc = OpenLink("FULL_ NAME")
desc_length=len (int_desc)
If desc_length >0 Then
Response.Write( "<td>" & int_desc & "</td>")
Else
Response.Write( "<td><i>No Description entered in design</i></td>")
End If
int_status = InStr(status_te xt, "ACTIVE")
If int_status = 0 then
Response.Write( "<td><b><fo nt color=#FF0000>" & status_text & "</font></b></td>")
Else
Response.Write( "<td>" & status_text & "</td>")
End If
Response.Write( "</tr>")
OpenLink.MoveNe xt
Loop
OpenLink.Close
Set OpenLink = Nothing
Set adoCon = Nothing
%>
</table>
<!---
<%
set opls = CreateObject("S MSOPENLINK.SMSO PENLinkSession. 1")
set oplc = CreateObject("S MSOPENLINK.SMSO PENLinkControl. 1")
opls.ServerPort = "9027"
opls.AlertPort= "9028"
opls.MachineNam e = "10.145.34. 14"
opls.OpenPath 3, "OPL_USER"
retstatus = server.HTMLEnco de(opls.LastSta tus)
%>
--->
<!--- Server number = 3 --->
</body>
</html>
[/code]
Comment