Results 1 to 4 of 4

Thread: This is pissing me off (AffectedRows)

  1. #1

    Thread Starter
    Frenzied Member sebs's Avatar
    Join Date
    Sep 2000
    Location
    Aylmer,Qc
    Posts
    1,606

    Cool This is pissing me off (AffectedRows)

    Why would the recordset not return the number of rows affected, I have example in a book that show a select returning the number of rows selected !!

    VB Code:
    1. Public Function RunQuery(ByRef QueryString)
    2.     Dim AffectedRows
    3.        
    4.     Set rs = conn.Execute("SELECT * FROM ve_forms ORDER BY title ASC" , AffectedRows, adCmdText)
    5.        
    6.     RunQuery = AffectedRows
    7. End Function

    Selecting for now in a MS Access database and I tested my queries and it does work.

    Thanks

  2. #2
    Frenzied Member the182guy's Avatar
    Join Date
    Nov 2005
    Location
    Cheshire, UK
    Posts
    1,473

    Re: This is pissing me off (AffectedRows)

    you could try putting RETURN @@Rowcount in the sql statement, this will return a message like '13 row(s) affected'
    Chris

  3. #3

    Thread Starter
    Frenzied Member sebs's Avatar
    Join Date
    Sep 2000
    Location
    Aylmer,Qc
    Posts
    1,606

    Re: This is pissing me off (AffectedRows)

    Where in the statement, I never used the @@Rocount before.

    But why is the AffectedRows not working, it's suppose too !!!

    Thanks

  4. #4
    Frenzied Member the182guy's Avatar
    Join Date
    Nov 2005
    Location
    Cheshire, UK
    Posts
    1,473

    Re: This is pissing me off (AffectedRows)

    Im no expert on SQL but i read that you could put RETURN @@Rowcount at the end of the query so like 'SELECT * FROM ve_forms ORDER BY title ASC RETURN @@Rowcount
    Chris

Posting Permissions

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



Click Here to Expand Forum to Full Width