Zero String???

Results 1 to 3 of 3

Thread: Zero String???

  1. #1
    Marie Guest

    Default Zero String???

    This is a confirm page. After user click submit button on the "Submit.asp", it will direct to this confirm page. The confirm.asp will display the data he keyed, and asked for confirmation. Upon the user clicking the confirm button, it will then submit the data into the database.<BR><BR>However, upon submitting to the database, there is an error occured saying "cat cannot be a zero-string". How do i correct this?<BR><BR>Following is a confirm.asp : <BR>&#060;%if Request("Confirm") = "1" Then &#037;&#062;<BR>&#060;% <BR>Set DataConn = Server.CreateObject("ADODB.Connection")<BR>DataCon n.Open "maindb"<BR>SQLQuery = "INSERT INTO Students (Cat) " & _<BR>"VALUES(&#039"& Request("Cat") &"&#039 )"<BR>Set Students = DataConn.Execute(SQLQuery)<BR>Dataconn.Close<BR>&# 037;&#062;<BR><BR>&#060;%Else &#037;&#062;<BR><BR>&#060;Form Name= "Form"><BR>Name= &#060;%=request("SName")&#037;&#062; <BR><BR>Name1= &#060;%=request("SNum")&#037;&#062; <BR><BR>Name2= &#060;%=request("CtNum")&#037;&#062; <BR><BR>Name3= &#060;%=request("Cat")&#037;&#062; <BR><BR>Name4= &#060;%=request("Item")&#037;&#062; <BR><BR>Name5= &#060;%=request("ItemD")&#037;&#062; <BR><BR>&#060;Input Type= "Submit" Value="Confirm" Name= "Submit"><BR>&#060;Input Type= "hidden" Value="undefined" Name="confirm"><BR><BR>&#060;script language=vbscript><BR>sub Submit_onClick<BR>window.document.form.confirm.val ue="1"<BR>window.document.form.action="confirm.asp "<BR>window.document.form.method="post"<BR>end sub<BR>&#060;/script><BR>&#060;/form> <BR><BR>&#060;%End If&#037;&#062;

  2. #2
    Mark Hoffman Guest

    Default RE: Zero String???

    It isn&#039t your ASP code, it&#039s your database. I&#039m gonna guess you&#039re using Access.<BR><BR>In Access, go back to the table design mode and you will notice down at the bottom of the page there is a list of properties. One of those is "Allow zero length strings?" It defaults to no. That&#039s your problem. Just change this to yes.<BR><BR>Mark Hoffman<BR>D Animation Multimedia and Web Design<BR>mark@d-animation.com<BR>

  3. #3
    marie Guest

    Default Now the data in my database are zero-string...

    I&#039ve done what you have told me to. But now the data in database become blank... Help me out again,pls.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •