IF Then statement

Results 1 to 2 of 2

Thread: IF Then statement

  1. #1
    Join Date
    Dec 1969

    Default IF Then statement

    Okay, I want an "If Then" statement that checks a database to see if a record exists (checks by "sku"). If it doesn&#039;t, then it will go into a "Add" sequence. If does exist, then it goes into an "Edit" sequence. I know it sounds simple enough, but believe it or not I am having trouble with it. Below is a shwagg version of what I got.<BR><BR><BR><BR>Dim pimprs, pimpSQL<BR>myconnection.Open "DSN=myDSN"<BR><BR>skuvar = request.querystring("sku")<BR>pimpSQL = "SELECT sku FROM MYTABLE WHERE sku = &#039;"& skuvar &"&#039;;"<BR>Set pimprs = myconnection.Execute(pimpSQL)<BR><BR>If pimpRS.EOF then<BR> &#039;****** ADD IF IT DONT EXIST******************<BR> &#039;Add Area<BR> &#039;****** ADD IF IT DONT EXIST******************<BR>Else<BR> &#039;****** EDIT IF IT EXISTS*********************<BR> &#039;Edit Area<BR> &#039;****** EDIT IF IT EXISTS*********************<BR>End If<BR><BR><BR>BTW, for all the curious people, pimp stands for "product information modifying process" <BR><BR>Thank You<BR>-ferretworks<BR>

  2. #2
    Join Date
    Dec 1969

    Default FAQs

    The answer lies within....<BR><BR>Dunno which number it is though.

Posting Permissions

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