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.
<html><head>
<TITLE>Get Student Data</TITLE>
<HTA:Application
ID="GSD"
APPLICATIONNAME="Get Student Data"
Border="none"
Caption="no"
SingleInstance="yes"
WindowState="maximize">
</head>
<script language="VBScript">
option Explicit
On Error Resume Next
sub Window_onLoad
Dim fso, conn, SQuery, Rst, dataOutput
'Creates the DB connection peramiters
set fso = CreateObject("Scripting.FileSystemObject")
set conn = CreateObject("ADODB.connection")
conn.ConnectionTimeout=30
conn.CommandTimeout=30
'connects to the ODBC database
conn.open ="RU"
'Sets the query
SQuery = "SELECT * From Students;"
'executes the query
Set Rst = conn.Execute(SQuery)
'makes sure we start reading at the begining of the table'
Rst.MoveFirst
dataOutput = "<table> "
'loops through the table and writes the data to a var
While Not Rst.EOF
dataOutput = dataOutput & "<tr> "
dataOutput = dataOutput & "<td> " & Rst("ContactID") & " </td> "
dataOutput = dataOutput & "<td> " & Rst("FirstName") & " </td> "
dataOutput = dataOutput & "<td> " & Rst("LastName") & " </td> "
dataOutput = dataOutput & "<td> " & Rst("Address") & " </td> "
dataOutput = dataOutput & "</tr>"
Rst.MoveNext
Wend
dataOutput = dataOutput & " </table> "
'close the DB
Rst.Close
'Writes the table to the webpage
DataArea.InnerHtml = dataOutput
'close all connections
Set fso = Nothing
conn.Close
Set conn = Nothing
End Sub
</script>
<body>
<span id="DataArea"></span>
<p></p>
</html>