Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

error '80040e21'

Status
Not open for further replies.

LaPluma

Programmer
Feb 3, 2002
139
DE
Hello

I am getting two error messages with the following script.

They are:

Microsoft JET Database Engine error '80040e21'

Field 'Forum.Email' cannot be a zero-length string.

/guest/gsave.asp, line 65

and:

Microsoft JET Database Engine error '80040e21'

Field 'Forum.Message' cannot be a zero-length string.

/guest/gsave.asp, line 65

For some reason, I don't get the error message with the other two fields (name and subject). Can any kind soul suggest what I am doing wrong?

Many thanks

LaPluma

<%
dim objRS, strSQL
dim strName, strSubject, strMessage, strEmail, strDate, strTime

strSQL = &quot;SELECT * FROM Forum&quot;
set objRS = server.CreateObject(&quot;ADODB.RecordSet&quot;)
objRS.Open strSQL, objConn,1,2

strName = Request.Form(&quot;txtName&quot;)
strSubject = Request.Form (&quot;txtSubject&quot;)
strMessage = Request.Form (&quot;txtMessage&quot;)
strEmail = Request.Form(&quot;txtEmail&quot;)
strDate = (Date)
strTime = (Time)


strMessage = Replace(strMessage,chr(10),&quot;<BR>&quot;)


If strName=&quot;&quot; or strSubject=&quot;&quot; or strMessage=&quot;&quot; or strEmail=&quot;&quot; Then
Response.Write &quot;Please click <a href=&quot;&quot;&quot; &_
&quot;javascript:history.go(-1)&quot;&quot;>here</A> to type in your &quot;
Select Case &quot;&quot;
Case strName Response.Write &quot;Name&quot;
Case strSubject Response.Write &quot;Subject&quot;
Case strMessage Response.Write &quot;Message&quot;
Case Else Response.Write &quot;Email&quot;
End Select
Response.Write &quot;&quot; & vbCrLf
End If
Response.End


objRS.AddNew
objRS(&quot;Name&quot;) = strName
objRS(&quot;Subject&quot;) = strSubject
objRS(&quot;Message&quot;) = strMessage
objRS(&quot;Email&quot;) = strEmail
objRS(&quot;Date&quot;) = strDate
objRS(&quot;Time&quot;) = strTime

objRS.Update

Response.Write &quot;<center>The guestbook has been updated with your message</center>&quot;
Response.Write &quot;<center>Please click <a href='gbook.asp'>here</a> to go back to the guestbook</center>&quot;

%>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top