View Single Post
  #2 (permalink)  
Old December 22nd, 2004, 11:26 AM
stu9820 stu9820 is offline
Friend of Wrox
 
Join Date: Jun 2003
Location: , , USA.
Posts: 1,111
Thanks: 0
Thanked 3 Times in 3 Posts
Default

You can try this:

    Dim strSQL As String
    Dim strCOUNT As String
    Dim objCommand As New OleDbCommand

    objCommand.Connection = objConn
    strSQL = "SELECT COUNT(*) AS in_process FROM tbl_current_call_list WHERE repname ='" & repname & "' AND in_process='yes'"
    objCommand.CommandText = strSQL
    objCommand.CommandType = CommandType.Text

    objConn.Open()
    strCOUNT = CType(objCommand.ExecuteScalar, String)
    objConn.Close()


strCOUNT will hold the value of the COUNT(*)