Select Count question

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: David Smith (DJSmith_at_mail.ci.dallas.tx.us)
Date: 02/08/05


Date: Tue, 8 Feb 2005 13:30:33 -0600

Its been 3 years since I coded and I'm trying to remember little things.
This is one of them.

I want to run a select count(*) statement and get the number of records
meeting the criteria. What is the syntax for assigning the returned value
to a variable.

I tried the following

adoConnect.Execute CallHold, counted

where callhold is the sql statement and counted is the variable I want the
result to be assigned to.

 I get a return of -1 which can't be correct. Can someone please answer
this simple question for me? Thanks



Relevant Pages

  • Re: Select Count question
    ... What is the syntax for assigning the returned value ... where callhold is the sql statement and counted is the variable I want the ... The Execute method does not return data unless you implement a Recordset object to handle the ...
    (microsoft.public.vb.database.ado)
  • Re: Select Count question
    ... Is adoConnect a RecordSet object? ... What is the syntax for assigning the returned value ... > where callhold is the sql statement and counted is the variable I want the ...
    (microsoft.public.vb.database.ado)
  • Inserting rows syntax + row #ing code in protected sheet?
    ... The syntax to put basically at beginning and end of a macro that's assigned ... didn't realize that the insert function is gone once a sheet is protected ... then assigning a message box macro to it to say "unprotect the sheet to ... insert rows, then protect again" if worse came to worst, but I feel that ...
    (microsoft.public.excel.programming)
  • Variable names in SQL
    ... My VBA code has an SQL statement to call. ... I'm assigning the statement to a ... How do I mark testvalue in the select string? ...
    (microsoft.public.excel.programming)
  • Re: Getting value from asp:label into javascript input value
    ... In regular asp the syntax for assigning an asp global variable to a ... javascript var is: ... Prev by Date: ...
    (comp.lang.javascript)