Results 1 to 2 of 2

Thread: VB SQL Count

  1. #1
    Join Date
    Dec 2003
    Posts
    22

    Unanswered: VB SQL Count

    Hi

    I am linking to SQL plus, through VB. Set up connection string, works fine. I want to count the number of records in memberID field from VB

    Code

    Dim rsMembers As ADODB.Recordset
    Dim temp As String

    'Creates a new record set
    Set rsMembers = New ADODB.Recordset

    'Puts the sql in a var
    temp = "SELECT Count(MemberID) " & _
    "FROM Member "

    'Passing the query to the recordset
    rsMembers.Source = temp

    'Tells the recordset which connection to use for the database
    Set rsMembers.ActiveConnection = cn

    'Opens recordset
    rsAmountOfActiveMembers.Open

  2. #2
    Join Date
    Mar 2003
    Location
    The Bottom of The Barrel
    Posts
    6,102
    Provided Answers: 1
    hmm... try this:

    rsAmountOfActiveMembers.Open temp, cn, YourKeysetParam, YourLockParam, adCmdText

Posting Permissions

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