VB 6.0 - How to use OpenSchema and adSchemaProcedureColumns to find columns of a Stored Procedure

Asked By Niz Niz on 07-Mar-14 12:46 AM

Hi,


I am trying to get the list of columns (fields) in a stored procedure.

I know I am supposed to use OpenSchema along with adSchemaProcedureColumns. However, the I could not get the correct syntax to use it.


I am attempting the following code:


1.Dim rsCols as ADODB.Recordset
2.Set rsCols = New ADODB.Recordset
3. 
4.Set rsCols = gOLEConn.OpenSchema(adSchemaProcedureColumns, Array(Empty, Empty, "MyProcName"))
5.do While Not rsCols.EOF
6.  Debug.Print rsCols!COLUMN_NAME
7.  rsCols.MoveNext
8.Loop

When executing the code, at line 4, it gives me an Error '3251 - Object or provider is not capable of performing requested'.  No parameters in the SP. Importantly: I am using Sybase 15.


Any suggestions/help much appreciated.


Niz Niz

Robbe Morris replied to Niz Niz on 07-Mar-14 09:12 AM
No dice.  It is telling that you Sybase doesn't support retrieving this specific type of schema information.
Niz Niz replied to Robbe Morris on 09-Mar-14 02:35 PM

Thank Robbe.


OpenSchema works for all objects in Sybase - like tables and views but not for procedures. I suppose some Sybase guys can see this post and help me with it. If not, have alternate ways by opening the SP with 1=2 and then reading the columns - it's a dirty way but does the job.


Tks and bi