Hi guys, I was having trouble with a form, it's entering data into 4 seperate tables in my database. I had to figure out a way to check the form values to make sure there was data before submitting to the database (tables) ok i successfully figured that out, but now i'm having another problem. When i submit the form with no data (for testing) i get an error saying "Expected End line 204" i can't figure it out. I'll post the code. any help would be greatly appreciated...
<%@ LANGUAGE="VBSCRIPT" %>
<%
Option Explicit
Response.Buffer = True
Response.ContentType = "text/html; charset=iso-8859-1"
'--------------------------------------------------------------
'--- Module: .asp
'---
'--- Version: 1.0
'---
'--- Purpose:
'---
'--- Dependencies:
'---
'--- Notes:
'---
'--- Author: Gene Magerr genemagerr@hotmail.com
'--- Copyright 2001 Magerr Media all rights reserved
'--------------------------------------------------------------
%><!--#include file="../../adovbs.inc"--><%
'--------------------------------------------------------------
Dim rsComp, rsTester, rsTools, rsVehicle, cnTelmon
'--------------------------------------------------------------
'--- Insert into table Computers
'--------------------------------------------------------------
Set cnTelmon = Server.CreateObject("ADODB.Connection"
cnTelmon.Open "DSN=Telmon"
Set rsComp = Server.CreateObject("ADODB.Recordset"
rsComp.Open "Computers", cnTelmon, adOpenStatic, adLockOptimistic
If Request.Form("compSerialNo"
<> "" Then
rsComp.AddNew
rsComp("SerialNo"
= Request.Form("compSerialNo"
End If
If Request.Form("CompDescription"
<> "" Then
rsComp.AddNew
rsComp("Description"
= Request.Form("compDescription"
End if
If Request.Form("compIssuedTo"
<> "" Then
rsComp.AddNew
rsComp("IssuedTo"
= Request.Form("compIssuedTo"
End If
If Request.Form("compDateIssued"
<> "" Then
rsComp.AddNew
rsComp("DateIssued"
= Request.Form("compDateIssued"
End if
If Request.Form("compNotes"
<> "" Then
rsComp.AddNew
rsComp("Notes"
= Request.Form("compNotes"
End If
rsComp.Update
rsComp.MoveLast
rsComp.Close
Set rsComp = Nothing
'--------------------------------------------------------------
'--- Insert into table Testers
'--------------------------------------------------------------
Set rsTester = Server.CreateObject("ADODB.Recordset"
rsTester.Open "Testers", cnTelmon, adOpenStatic, adLockOptimistic
If Request.Form("testerSerialNo"
<> "" Then
rsTester.AddNew
rsTester("SerialNo"
= Request.Form("testerSerialNo"
End If
If Request.Form("testerTester"
<> "" Then
rsTester.AddNew
rsTester("Tester"
= Request.Form("testerTester"
End if
If Request.Form("testerIssuedTo"
<> "" Then
rsTester.AddNew
rsTester("IssuedTo"
= Request.Form("testerIssuedTo"
End If
If Request.Form("testerDateIssued"
<> "" Then
rsTester.AddNew
If Request.Form("testerDateIssued"
<> "" Then
rsTester.AddNew
rsTester("DateIssued"
= Request.Form("testerDateIssued"
End If
If Request.Form("testerDownloaded"
<> "" Then
rsTester.AddNew
rsTester("Downloaded"
= Request.Form("testerDownloaded"
End If
If Request.Form("testerFlashed"
<> "" Then
rsTester.AddNew
rsTester("Flashed"
= Request.Form("testerFlashed"
End If
If Request.Form("testerNotes"
<> "" Then
rsTester.AddNew
rsTester("Notes"
= Request.Form("testerNotes"
End If
rsTester.Update
rsTester.MoveLast
rsTester.Close
Set rsTester = Nothing
'--------------------------------------------------------------
'--- Insert into table Vehicles
'--------------------------------------------------------------
Set rsVehicle = Server.CreateObject("ADODB.Recordset"
rsVehicle.Open "Vehicles", cnTelmon, adOpenStatic, adLockOptimistic
If Request.Form("vehicleLicense"
<> "" Then
rsVehicle.AddNew
rsVehicle("License"
= Request.Form("vehicleLicense"
End If
If Request.Form("vehicleVehicle"
<> "" Then
rsVehicle.AddNew
rsVehicle("Vehicle"
= Request.Form("vehicleVehicle"
End If
If Request.Form("vehicleIssuedTo"
<> "" Then
rsVehicle("IssuedTo"
= Request.Form("vehicleIssuedTo"
End If
If Request.Form("vehicleDateIssued"
<> "" Then
rsVehicle("DateIssued"
= Request.Form("vehicleDateIssued"
End If
If Request.Form("vehicleMileage"
<> "" Then
rsVehicle("Mileage"
= Request.Form("vehicleMileage"
End If
If Request.Form("vehicleServiceNotes"
<> "" Then
rsVehicle("ServiceNotes"
= Request.Form("vehicleServiceNotes"
End If
rsVehicle.Update
rsVehicle.MoveLast
rsVehicle.Close
Set rsVehicle = Nothing
'--------------------------------------------------------------
'--- Insert into table Tools
'--------------------------------------------------------------
Set rsTools = Server.CreateObject("ADODB.Recordset"
rsTools.Open "Tools", cnTelmon, adOpenStatic, adLockOptimistic
If Request.Form("toolsSerialNo"
<> "" Then
rsTools.AddNew
rsTools("SerialNo"
= Request.Form("toolsSerialNo"
End If
If Request.Form("toolsDescription"
<> "" Then
rsTools.AddNew
rsTools("Description"
= Request.Form("toolsDescription"
End If
If Request.Form("toolsIssuedTo"
<> "" Then
rsTools.AddNew
rsTools("IssuedTo"
= Request.Form("toolsIssuedTo"
End If
If Request.Form("toolsDateIssued"
<> "" Then
rsTools.AddNew
rsTools("DateIssued"
= Request.Form("toolsDateIssued"
End If
If Request.Form("toolsNotes"
<> "" Then
rsTools.AdNew
rsTools("Notes"
= Request.Form("toolsNotes"
End If
rsTools.Update
rsTools.MoveLast
rsTools.Close
Set rsTools = Nothing
Response.Redirect "Inventory.asp"
'--------------------------------------------------------------
'--- Initialization
'--------------------------------------------------------------
'--------------------------------------------------------------
'--- Body
'--------------------------------------------------------------
'--------------------------------------------------------------
'--- Begin HTML output
'--------------------------------------------------------------
%>
<HTML>
<HEAD>
<TITLE>Untitled</TITLE>
</HEAD>
<BODY>
</BODY>
</HTML>
<%
'----------------------------------------------------------------------
'--- End HTML Output
'----------------------------------------------------------------------
cnTelmon.Close
Set cnTelmon = Nothing
'----------------------------------------------------------------------
'--- All ASP post processing code goes here, as well as
'--- sub routines and functions
'----------------------------------------------------------------------
%>
This is the page it goes to after you click submit on the form this checks for data and submits to the database.
Oh by the way, line 204 on my machine is the closing %> at the very bottom of the page. thanks in advance.
<%@ LANGUAGE="VBSCRIPT" %>
<%
Option Explicit
Response.Buffer = True
Response.ContentType = "text/html; charset=iso-8859-1"
'--------------------------------------------------------------
'--- Module: .asp
'---
'--- Version: 1.0
'---
'--- Purpose:
'---
'--- Dependencies:
'---
'--- Notes:
'---
'--- Author: Gene Magerr genemagerr@hotmail.com
'--- Copyright 2001 Magerr Media all rights reserved
'--------------------------------------------------------------
%><!--#include file="../../adovbs.inc"--><%
'--------------------------------------------------------------
Dim rsComp, rsTester, rsTools, rsVehicle, cnTelmon
'--------------------------------------------------------------
'--- Insert into table Computers
'--------------------------------------------------------------
Set cnTelmon = Server.CreateObject("ADODB.Connection"
cnTelmon.Open "DSN=Telmon"
Set rsComp = Server.CreateObject("ADODB.Recordset"
rsComp.Open "Computers", cnTelmon, adOpenStatic, adLockOptimistic
If Request.Form("compSerialNo"
rsComp.AddNew
rsComp("SerialNo"
End If
If Request.Form("CompDescription"
rsComp.AddNew
rsComp("Description"
End if
If Request.Form("compIssuedTo"
rsComp.AddNew
rsComp("IssuedTo"
End If
If Request.Form("compDateIssued"
rsComp.AddNew
rsComp("DateIssued"
End if
If Request.Form("compNotes"
rsComp.AddNew
rsComp("Notes"
End If
rsComp.Update
rsComp.MoveLast
rsComp.Close
Set rsComp = Nothing
'--------------------------------------------------------------
'--- Insert into table Testers
'--------------------------------------------------------------
Set rsTester = Server.CreateObject("ADODB.Recordset"
rsTester.Open "Testers", cnTelmon, adOpenStatic, adLockOptimistic
If Request.Form("testerSerialNo"
rsTester.AddNew
rsTester("SerialNo"
End If
If Request.Form("testerTester"
rsTester.AddNew
rsTester("Tester"
End if
If Request.Form("testerIssuedTo"
rsTester.AddNew
rsTester("IssuedTo"
End If
If Request.Form("testerDateIssued"
rsTester.AddNew
If Request.Form("testerDateIssued"
rsTester.AddNew
rsTester("DateIssued"
End If
If Request.Form("testerDownloaded"
rsTester.AddNew
rsTester("Downloaded"
End If
If Request.Form("testerFlashed"
rsTester.AddNew
rsTester("Flashed"
End If
If Request.Form("testerNotes"
rsTester.AddNew
rsTester("Notes"
End If
rsTester.Update
rsTester.MoveLast
rsTester.Close
Set rsTester = Nothing
'--------------------------------------------------------------
'--- Insert into table Vehicles
'--------------------------------------------------------------
Set rsVehicle = Server.CreateObject("ADODB.Recordset"
rsVehicle.Open "Vehicles", cnTelmon, adOpenStatic, adLockOptimistic
If Request.Form("vehicleLicense"
rsVehicle.AddNew
rsVehicle("License"
End If
If Request.Form("vehicleVehicle"
rsVehicle.AddNew
rsVehicle("Vehicle"
End If
If Request.Form("vehicleIssuedTo"
rsVehicle("IssuedTo"
End If
If Request.Form("vehicleDateIssued"
rsVehicle("DateIssued"
End If
If Request.Form("vehicleMileage"
rsVehicle("Mileage"
End If
If Request.Form("vehicleServiceNotes"
rsVehicle("ServiceNotes"
End If
rsVehicle.Update
rsVehicle.MoveLast
rsVehicle.Close
Set rsVehicle = Nothing
'--------------------------------------------------------------
'--- Insert into table Tools
'--------------------------------------------------------------
Set rsTools = Server.CreateObject("ADODB.Recordset"
rsTools.Open "Tools", cnTelmon, adOpenStatic, adLockOptimistic
If Request.Form("toolsSerialNo"
rsTools.AddNew
rsTools("SerialNo"
End If
If Request.Form("toolsDescription"
rsTools.AddNew
rsTools("Description"
End If
If Request.Form("toolsIssuedTo"
rsTools.AddNew
rsTools("IssuedTo"
End If
If Request.Form("toolsDateIssued"
rsTools.AddNew
rsTools("DateIssued"
End If
If Request.Form("toolsNotes"
rsTools.AdNew
rsTools("Notes"
End If
rsTools.Update
rsTools.MoveLast
rsTools.Close
Set rsTools = Nothing
Response.Redirect "Inventory.asp"
'--------------------------------------------------------------
'--- Initialization
'--------------------------------------------------------------
'--------------------------------------------------------------
'--- Body
'--------------------------------------------------------------
'--------------------------------------------------------------
'--- Begin HTML output
'--------------------------------------------------------------
%>
<HTML>
<HEAD>
<TITLE>Untitled</TITLE>
</HEAD>
<BODY>
</BODY>
</HTML>
<%
'----------------------------------------------------------------------
'--- End HTML Output
'----------------------------------------------------------------------
cnTelmon.Close
Set cnTelmon = Nothing
'----------------------------------------------------------------------
'--- All ASP post processing code goes here, as well as
'--- sub routines and functions
'----------------------------------------------------------------------
%>
This is the page it goes to after you click submit on the form this checks for data and submits to the database.
Oh by the way, line 204 on my machine is the closing %> at the very bottom of the page. thanks in advance.