I've read through a few threads on here about Classic ASP and Javascript, but can not find anything that is totally helpful.
I'm trying to convert my working vb script into Javascript, but am running into problems.
Here is my code:
<%
//Declare variables
var formdate, jsia, jsga, yvcia, yvcga, query, myDSN, Connect, rs;
//Provider String and DB location
myDSN = "PROVIDER=MICROSOFT.ACE.OLEDB.12.0;DATA SOURCE=" & Server.Mappath("/MasterDB.accdb");
//myDSN = "PROVIDER=SQLOLEDB.1;SERVER=myServerAddress;DATABASE=myDataBase;UID=myUserName;PWD=myPassword";
//Collect data from form
formdate = Request.Form("date");
jsia = Request.Form("jsia");
jsga = Request.Form("jsga");
yvcia = Request.Form("yvcia");
yvcga = Request.Form("yvcga");
//SQL for Query
query = "SELECT * FROM ATTENDANCE;";
//Create and open connection to database
Connect = Server.CreateObject("ADODB.Connection");
Connect.Open myDSN;
//Create recordset
rs = Server.CreateObject("ADODB.recordset");
//Open recordset run query in database
rs.Open query, Connect, adOpenStatic, adLockOptimistic;
rs.AddNew
rs("Attendance_Date") = formdate;
rs("JS_Individuals") = jsia;
rs("JS_Groups") = jsga;
rs("YVC_Individuals") = yvcia;
rs("YVC_Groups") = yvcga;
rs.Update;
//Display message
Response.Write("<h1>Your form has been received. Thank you.</h1>");
//Close recordset and database connection
rs.close;
Connect.close;
%>
Any tips or documentation I can read on this? I've checked w3schools but they only cover VB script for Classic ASP.
Thanks!
<script runat="server" language="jscript">section to host your user input checking functions. There is a caveat about running both languages on the same page, but it probably does not apply to your situation.