Hi all, thank you for taking the time to try and help me with a problem I'm having.
I have written a html page that posts a form to a .asp page, which in turn is supposed to write data to a MS Access database. Problem is while my html page works, and my .asp page seems to work fine as well, nothing is being saved to my database!
I'm not sure if its something wrong in my .asp page...
Code:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<% Option Explicit %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Submit Hours</title>
</head>
<body>
<%
Dim num, employee, dept, branch, org, hours, mnth, yr
Dim MyConn, SQL_query
num = Request.Form("number")
employee = Request.Form("name")
dept = Request.Form("dept")
branch = Request.Form("branch")
org = Request.Form("org")
hours = CInt(Request.Form("hours"))
mnth = Request.Form("month")
yr = Request.Form("year")
Set MyConn = Server.CreateObject("ADODB.Connection")
MyConn.Open "Driver={Microsoft Access Driver (*.mdb)}; DBQ=C:\inetpub\wwwroot\human_resources\volunteerhours\volunteerhours.mdb; "
SQL_query = "INSERT INTO VolunteerHours ([Clock#], Employee, Department, Branch, Organization, Hours, [Month], [Year])" & _
"VALUES ('" & num & _
"','" & employee & _
"','" & dept & _
"','" & branch & _
"','" & org & _
"'," & hours & _
",'" & mnth & _
"','" & yr & _
"')"
MyConn.Execute(SQL_query)
response.write "The form information was inserted successfully."
response.write num
MyConn.close
set MyConn = nothing
%>
</body>
</html>
or if you think there may be some configuration in my database I'm missing. Just an FYI all the database table columns take empty values.
Thanks for the help!!!