Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
ADO - See if Stored Procedures are supported.
Message
From
18/06/2001 12:26:53
 
 
To
18/06/2001 03:46:47
General information
Forum:
Visual FoxPro
Category:
ActiveX controls in VFP
Miscellaneous
Thread ID:
00520466
Message ID:
00520652
Views:
12
This message has been marked as a message which has helped to the initial question of the thread.
>I want to be able to see if stored procedures are supported on (almost any)
>platform. I noticed if I connect to some ODBC sources with the OLE-DB provider
>I can do
>cn.properties("Stored Procedures")
>
>But this property doesn't exist on SQL Server.
>
>So the question is how can I reliably check if a stored procedure is supported.
>The point is I will call the stored procedure if it is supported I will have created it otherwise I will execute SQL. I suppose I could just call it and trap the error but I was hoping to use a property if one existed?
>
>Thanks...

Tim,

On the UT downloads I have a utility that queries a SQL Server backend for the names of the defined stored procedures. It then goes on to generate the necessary parameters collection to make a call to the selected sp. You may get some ideas by looking at the code there.

Basically, you can check the connection to see if the Parameters.Refresh method is supported and search for the specific sp. If it is not supported then you have to check other means.

Another means of obtaining information about databases is ADOX, where you can query several collections to find the needed information. For example, there is a procedures collection in the catalog object there. I suspect that it would be the same as the Parameters.Refresh method in that not all providers will support it, but you might want to give it a try anyway. HTH
Previous
Reply
Map
View

Click here to load this message in the networking platform