SQL Question

Results 1 to 2 of 2

Thread: SQL Question

  1. #1
    Join Date
    Dec 1969

    Default SQL Question

    Hi, i have the following code to only select males from my Members table.. but i don&#039t know how to output it to html..any ideas??<BR><BR>Set db = Server.CreateObject("ADODB.Connection")<BR>db.Open "DSN=my_dsn"<BR><BR>sql = "SELECT COUNT (*) FROM Members WHERE CurrentlyIn = &#039UK&#039"<BR>db.Execute (sql)

  2. #2
    Join Date
    Dec 1969

    Default RE: SQL Question

    Try this:<BR><BR>Dim db, rs<BR><BR>Set db = Server.CreateObject("ADODB.Connection")<BR>db.Open "DSN=my_dsn"<BR><BR>sql = "SELECT COUNT(*) as CountOfMales FROM Members WHERE CurrentlyIn = &#039UK&#039"<BR>set rs = db.Execute(sql)<BR><BR>response.write rs("CountOfMales")<BR><BR>rs.Close<BR>Set rs = nothing<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