Help me in correct the zero strings....

Results 1 to 2 of 2

Thread: Help me in correct the zero strings....

  1. #1
    Marie Guest

    Default Help me in correct the zero strings....

    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. <BR><BR>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>Someone told me to set the database field properties to zero-string, in which I dun agree as all my data must NOT be in zero-string. so I believe that it&#039s the programming problems...<BR><BR>Anyone can give me some fast guides or links abt session object?<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>Name1= &#060;%=request("SNum")&#037;&#062; <BR>Name2= &#060;%=request("CtNum")&#037;&#062; <BR>Name3= &#060;%=request("Cat")&#037;&#062; <BR>Name4= &#060;%=request("Item")&#037;&#062; <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
    Join Date
    Dec 1969
    Posts
    218

    Default RE: Help me in correct the zero strings....

    Try this <BR>strVariable = Request("Cat") & ""<BR>SQLQuery = "INSERT INTO Students (Cat) " & _<BR>"VALUES(&#039"& strVariable &"&#039 )"<BR><BR>it should work

Posting Permissions

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