Checking entry ...
<%
'---- CursorTypeEnum Values ----
Const adOpenForwardOnly = 0
Const adOpenKeyset = 1
Const adOpenDynamic = 2
Const adOpenStatic = 3
'---- LockTypeEnum Values ----
Const adLockReadOnly = 1
Const adLockPessimistic = 2
Const adLockOptimistic = 3
Const adLockBatchOptimistic = 4
'---- CommandTypeEnum Values ----
Const adCmdUnknown = &H0008
Const adCmdText = &H0001
Const adCmdTable = &H0002
Const adCmdStoredProc = &H0004
Dim FirstName, LastName, PosTitle, Company, Phone, PhoneExt, Fax, email, Address
Dim City, State, Region, Country, Zip, FedEx, ProgramTitle, Purpose, When
Dim ErrorFound
Sub ReportError (message)
Response.Write "
" & message
ErrorFound = True
End Sub
ErrorFound = False
FirstName = Request.Form ("FirstName")
LastName = Request.Form ("LastName")
PosTitle = Request.Form ("PosTitle")
Company = Request.Form ("Company")
Phone = Request.Form ("Phone")
PhoneExt = Request.Form ("PhoneExt")
Fax = Request.Form ("Fax")
email = Request.Form ("email")
Address = Request.Form ("Address")
City = Request.Form ("City")
State = Request.Form ("State")
Region = Request.Form ("Region")
Country = Request.Form ("Country")
Zip = Request.Form ("Zip")
FedEx = Request.Form ("FedEx")
ProgramTitle = Request.Form ("ProgramTitle")
Purpose = Request.Form ("Purpose")
When = Request.Form ("When")
' First check that all required entries are there
If FirstName = "" Then ReportError ("Please tell us your first name")
If LastName = "" Then ReportError ("Please tell us your last name")
If PosTitle = "" Then ReportError ("Please tell us your title")
If Company = "" Then ReportError ("Please tell us your company's name")
If Phone = "" Then ReportError ("Please tell us your phone number")
If Address = "" Then ReportError ("Please tell us your address")
If City = "" Then ReportError ("Please tell us your city")
If State = "" Then ReportError ("Please tell us your state")
If Country = "" Then ReportError ("Please tell us your country")
If Zip = "" Then ReportError ("Please tell us your postal code")
If ErrorFound Then
Response.Write "
Errors found. Please click here to try again"
Else
Response.Write "
Adding entry ..."
Dim szDSN, szSQL, rstData, intFields, rst
' open connection
Set Cnxn = Server.CreateObject("ADODB.Connection")
' strCnxn = "Provider=sqloledb;Data Source=ACTP;"
' strCnxn = "Provider=sqloledb;Data Source=MyServer;Initial Catalog=northwind;User Id=sa;Password=;
strCnxn = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\INetPub\WWWRoot\ACTP\request\request.mdb;"
Cnxn.Open strCnxn
Set rst = Server.CreateObject("ADODB.Recordset")
' -- Supply a SQL statement to query by
'szSQL = "SELECT ID=ContactID, 'Download Date'=InitialContactDate, 'First Name'=FirstName, 'Last Name'=LastName, 'Company'=CompanyName FROM requests ORDER BY InitialContactDate"
'szSQL = "SELECT ContactID, InitialContactDate, FirstName, LastName, CompanyName FROM requests ORDER BY InitialContactDate"
szSQL = "requests"
' -- Execute the query on the data source
rst.ActiveConnection = Cnxn
' rst.CursorLocation = adUseClient
' rst.CursorType = adOpenKeyset
rst.LockType = adLockOptimistic
rst.Source = szSQL
rst.Open
rst.AddNew
rst ("FirstName") = FirstName
rst ("LastName") = LastName
rst ("Title") = PosTitle
rst ("CompanyName") = Company
rst ("WorkPhone") = Phone
rst ("WorkExtension") = PhoneExt
rst ("FaxNumber") = Fax
rst ("EmailName") = email
rst ("Address") = Address
rst ("City") = City
rst ("StateOrProvince") = State
rst ("Region") = Region
rst ("Country") = Country
rst ("PostalCode") = Zip
rst ("FedExNo") = FedEx
rst ("ProgramTitle") = ProgramTitle
rst ("Purpose") = Purpose
If When <> "" Then rst ("Deadline") = When
rst.Update
rst.Close
Response.Write "
Thank you for providing us with your information. You may now download "
Response.Write "our Image Distribution Policy by clicking here"
End If
%>