Value Error

Results 1 to 2 of 2

Thread: Value Error

  1. #1
    Conrad Guest

    Default Value Error

    I cannot get my code to NOT display the "value" field by using the following code.<BR><BR>&#060;% If NOT obj_recordset.BOF OR obj_recordset.EOF Then %&#062; Value="&#060;%= obj_recordset.Fields("Username") %&#062;" &#060;% End If %&#062;<BR><BR>The goal is to insert the value from the database only if there is a value in the database. Otherwise it throws an error. Using the BOF and EOF does not seem to work. <BR><BR>Any help would be most appreciated.<BR><BR>Conrad

  2. #2
    Join Date
    Dec 1969

    Default RE: Value Error

    your code doesn&#039t check for a missing Username value - it only checks for beginning and end of the file. you need to add some code to check for IsNull or ""<BR><BR>note....i haven&#039t tested this code!<BR><BR>&#060;%<BR>If NOT obj_recordset.BOF OR obj_recordset.EOF Then <BR>%&#062; <BR>Value="<BR>&#060;%<BR> If Not IsNull(obj_recordset.Fields("Username")) Then Response.Write obj_recordset.Fields("Username") <BR>%&#062;<BR>" <BR>&#060;%<BR>End If &#039bof / eof<BR>%&#062;<BR><BR>

Posting Permissions

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