t1hodges
MIS
- May 8, 2003
- 54
I Need to create a web page that allows users to first log in, then second add, edit, and delete records in an access database. there will be aprox. five users.
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
dim oRSstuff
dim strSQL
strSQL = "SELECT stuff, moreStuff, yetMoreStuff FROM aTable WHERE something=somethingElse"
set oRSstuff=Server.CreateObject("ADODB.recordset")
oRSstuff.open strSQL, "DSN=myDSN"
'do something here with the resulting recordset
Response.write "<p>" & oRSstuff['stuff'] & "</p>"
Response.write "<p>" & oRSstuff['moreStuff'] & "</p>"
Response.write "<p>" & oRSstuff['yetMoreStuff'] & "</p>"
'this last bit closes the connection and cleans up
oRSstuff.close
set oRSstuff=nothing
<html>
<head>
<HTA:APPLICATION
ID = "oApp"
APPLICATIONNAME = "MAC Metrics Report"
BORDER = "thick"
CAPTION = "yes"
ICON = "Report.ico"
SHOWINTASKBAR = "yes"
SINGLEINSTANCE = "yes"
SYSMENU = "yes"
WINDOWSTATE = "normal"
SCROLL = "yes"
SCROLLFLAT = "yes"
VERSION = "1.0"
INNERBORDER = "yes"
SELECTION = "no"
MAXIMIZEBUTTON = "yes"
MINIMIZEBUTTON = "yes"
NAVIGABLE = "yes"
CONTEXTMENU = "yes"
BORDERSTYLE = "normal"
>
<title>Report</title>
<script language="vbscript">
Dim reportstyle
Dim uppertable
Dim lowertable
FUnction RunReport()
Dim mytable
mytable="<table border='0' cellspacing='0' cellpadding='0'>"
' Method 1
Set Conn = CreateObject("ADODB.Connection")
ConStr = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=\\mysever\myfolder\mydb.mdb;Persist Security Info=False"
Conn.Open ConStr
' Method 2 - In case method 1 does not work based on provider drivers available on PC.
' Set Conn = CreateObject("ADODB.Connection")
' Conn.Open "Driver={Microsoft Access Driver (*.mdb)};Dbq=\\mysever\myfolder\mydb.mdb;Uid=admin;Pwd="
SQLQuery = "Select FirstName, LastName From MyTable"
Set rs = Conn.Execute(SQLQuery)
do until rs.eof
mytable=mytable&"<tr><td>" & rs("FirstName") & "</td><td>" & rs("LastName") & "</td></tr>"
rs.movenext
loop
Conn.close
mytable=mytable&"</table>"
RunReport = mytable
End Function
</script>
<script language="javascript">
function newreport(year)
{
//rebuild and display div.
var mydiv = document.getElementById('MyReport');
var outstr = RunReport();
mydiv.style.visibility = "visible";
mydiv.style.display = 'none';
mydiv.innerHTML = outstr;
mydiv.style.display = 'inline';
}
</script>
</head>
<body onload="window.resizeTo 900, 600">
<form method='post' action='' NAME='buildreport'>
<div id="MyReport" name="MyReport"></div>
<br>
<br>
<center><input type='button' name='changeyear' value='Run Report' onclick='newreport()'></center>
</form>
</body>
</html>