Results 1 to 7 of 7

Thread: ADOX doesn't see stored procedure

  1. #1

    Thread Starter
    New Member
    Join Date
    Mar 2006
    Location
    Toronto, Ontario, Canada
    Posts
    9

    ADOX doesn't see stored procedure

    I have discovered that the ADOX catalog does not seem to see more than 30 stored procedures.
    Is this a known limit?
    I get the error:
    'ADO could not find the object in the collection corresponding to the name or ordinal reference requested by the application. '
    but the procedure is definitely in the database.
    If I iterate through the procedure items using the for each next construct it only displays 30 procs, but there are actually 36.
    Access 2000 database VB6 using the ADO data access methods.

    Uwe

  2. #2
    PowerPoster
    Join Date
    Oct 2002
    Location
    British Columbia
    Posts
    9,758

    Re: ADOX doesn't see stored procedure

    An Access Query will either be in the ADOX Procedures or ADOX View collections, depending on Query's design.

    A query that references a form control will be considered a Procedure.

  3. #3

    Thread Starter
    New Member
    Join Date
    Mar 2006
    Location
    Toronto, Ontario, Canada
    Posts
    9

    Re: ADOX doesn't see stored procedure

    Thanks, your views answer helped.

    If I run the query in access the query returns 137 records.
    If I execute it from VB I get zero records returned.
    I tried the SQL statement pasted from Access:
    "SELECT [Bill Items].[Pet ID], [Bill Items].[Invoice #] FROM [Bill Items] WHERE ((([Bill Items].Code) Like ""HSP*"")) GROUP BY [Bill Items].[Pet ID], [Bill Items].[Invoice #] HAVING ((([Bill Items].[Pet ID])<>0)) ORDER BY [Bill Items].[Pet ID], [Bill Items].[Invoice #];"
    and I still do not get any records selected.

  4. #4
    PowerPoster
    Join Date
    Oct 2002
    Location
    British Columbia
    Posts
    9,758

    Re: ADOX doesn't see stored procedure

    Try changing HSP* to HSP%

  5. #5

    Thread Starter
    New Member
    Join Date
    Mar 2006
    Location
    Toronto, Ontario, Canada
    Posts
    9

    Re: ADOX doesn't see stored procedure

    I tried that and Access doesn't return any records with HSP% and neither does the code.
    Regards,
    Uwe

  6. #6
    PowerPoster
    Join Date
    Oct 2002
    Location
    British Columbia
    Posts
    9,758

    Re: ADOX doesn't see stored procedure

    Post your VB code.

  7. #7

    Thread Starter
    New Member
    Join Date
    Mar 2006
    Location
    Toronto, Ontario, Canada
    Posts
    9

    Re: ADOX doesn't see stored procedure

    I discovered the problem.

    The command processor extracts the SQL string from the stored procedure and executes that select.

    There is obviously a bug when you use the LIKE operator because I changed the WHERE to create a column using LEFT() and compared it to HSP and everything started to work.

    I suspect that the LIKE "HSP*" ends up in the SQL string and is comparing the the value including the quotes.
    Regards,
    Uwe

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