Weird Errors
I need your help.
The error message:
Database Results Error
Description: [Microsoft][ODBC Microsoft Access Driver] Field 'Appointment.UserID' cannot be a zero-length string.
Number: -2147467259 (0x80004005)
Source: Microsoft OLE DB Provider for ODBC Drivers
One or more form fields were empty. You should provide default values for all form fields that are used in the query.
The code:
<%@ LANGUAGE="VBSCRIPT" %>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>New Page 1</title>
</head>
<body>
<%
Dim UserID, PropertyID, Day, Time
UserID = Session("UserID")
PropertyID = Request.Form("PropertyID")
Day = Request.Form("Day")
Time = Request.Form("Time")
Response.Write UserID
Response.Write PropertyID
Response.Write Day
Response.Write Time
%>
<table>
<tbody>
<!--webbot bot="DatabaseRegionStart" startspan s-columnnames s-columntypes
s-dataconnection="RealWebDB" b-tableformat="TRUE" b-menuformat="FALSE"
s-menuchoice s-menuvalue b-tableborder="FALSE" b-tableexpand="FALSE"
b-tableheader="FALSE" b-listlabels="TRUE" b-listseparator="TRUE"
i-ListFormat="0" b-makeform="FALSE" s-recordsource s-displaycolumns
s-criteria s-order
s-sql="INSERT INTO Appointment (AgentID, UserID, PropertyID, PrefDay, PrefTime)<br>SELECT AgentID, '::UserID::', ::PropertyID::, '::Day::', '::Time::'<br>FROM Property<br>WHERE PropertyID = ::PropertyID::"
b-procedure="FALSE" clientside SuggestedExt="asp"
s-DefaultFields="UserID=&PropertyID=&Day=&am p;Time=&PropertyID="
s-NoRecordsFound="No records returned." i-MaxRecords="256" i-GroupSize="0"
BOTID="0" u-dblib="../../_fpclass/fpdblib.inc"
u-dbrgn1="../../_fpclass/fpdbrgn1.inc"
u-dbrgn2="../../_fpclass/fpdbrgn2.inc" tag="TBODY"
local_preview="<tr><td colspan=64 bgcolor="#FFFF00" align="left" width="100%"><font color="#000000">Database Results regions will not preview unless this page is fetched from a Web server with a web browser. The following table row will repeat once for every record returned by the query.</font></td></tr>"
preview="<tr><td colspan=64 bgcolor="#FFFF00" align="left" width="100%">This is the start of a Database Results region.</td></tr>" b-WasTableFormat="TRUE" -->
<%
fp_sQry="INSERT INTO Appointment (AgentID, UserID, PropertyID, PrefDay, PrefTime) SELECT AgentID, '::UserID::', ::PropertyID::, '::Day::', '::Time::' FROM Property WHERE PropertyID = ::PropertyID::"
fp_sDefault="UserID=&PropertyID=&Day=&Time=&Proper tyID="
fp_sNoRecords="<tr><td colspan=16 align=left width=""100%"">No records returned.</td></tr>"
fp_sDataConn="RealWebDB"
fp_iMaxRecords=256
fp_iCommandType=1
fp_iPageSize=0
fp_fTableFormat=True
fp_fMenuFormat=False
fp_sMenuChoice=""
fp_sMenuValue=""
fp_iDisplayCols=16
fp_fCustomQuery=True
BOTID=0
fp_iRegion=BOTID
%>
<!--webbot bot="DatabaseRegionEnd" startspan b-tableformat="TRUE"
b-menuformat="FALSE" u-dbrgn2="../../_fpclass/fpdbrgn2.inc"
i-groupsize="0" clientside tag="TBODY"
local_preview="<tr><td colspan=64 bgcolor="#FFFF00" align="left" width="100%"><font color="#000000">This is the end of a Database Results region.</font></td></tr>"
preview="<tr><td colspan=64 bgcolor="#FFFF00" align="left" width="100%"><font color="#000000">This is the end of a Database Results region.</font></td></tr>" -->
</tbody>
</table>
</body>
</html>
What i don't get is, "Response.Write" for "UserID" works perfectly, along with the "Response.Write" statements for "Day" and "Time" (i.e. they display the variables' contents).
However, "Date" and "Time" does not encounter errors during insertion, unlike "UserID".
What could be the probelm?
|