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
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.
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.
Re: ADOX doesn't see stored procedure
Try changing HSP* to HSP%
Re: ADOX doesn't see stored procedure
I tried that and Access doesn't return any records with HSP% and neither does the code.
Re: ADOX doesn't see stored procedure
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.