how to do this

Results 1 to 2 of 2

Thread: how to do this

  1. #1
    Join Date
    Dec 1969

    Default how to do this

    Hi,<BR><BR>I have a query in my program like this<BR><BR>set sub1 = server.createobject("ADODB.Connection")<BR>sub1.op en "name"<BR>set rs = server.CreateObject("ADODB.Recordset")<BR>stSQL = " select firstname,lastname,email,password from names"<BR><BR>I want to include something like this <BR>if password = ipp2000 then<BR>stSQL = stSQL & "where ...."<BR>end if<BR> rs.Open stSQL, sub1,adOpenStatic<BR><BR>Can I use the column names in the if statement without first opening the recordset because in my program based on if statement I have to use different where conditions. What is the best way of doing this.<BR><BR>Thanks,<BR>anup

  2. #2
    Join Date
    Dec 1969

    Default Ummm, well...

    Yeah you can, if you know the column headings, you can just jam them in there, if you don&#039;t, you could open a recordset and run through the recordset using a for loop looking at the objrec.fields(i).name attribute...<BR><BR>-- Whol

Posting Permissions

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