Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
rajender
Starting Member
13 Posts |
Posted - 2005-05-11 : 07:56:20
|
| Hi SQL TeamI am writing a SQL-DMO wrapper class in VB 6.0, the following code will give you some idea of the class structurePublic Function Tables(ByVal oSqlServer As SQLServer2, ByVal intDatabaseIndex As Integer) As SQLDMO.Tables Set Tables = oSqlServer.Databases.Item(intDatabaseIndex).TablesEnd FunctionPublic Function StoredProcedures(ByVal oSqlServer As SQLServer2, ByVal intDatabaseIndex As Integer) As SQLDMO.StoredProcedures Set StoredProcedures = oSqlServer.Databases.Item(intDatabaseIndex).StoredProceduresEnd FunctionThis class has similar functions for all other database objects i.e for views,users etc., but i don't find method to fetch user defined functions collection the same way as i did for other objects. For example when i try to implement following codePublic Function UserDefinedFunctions(ByVal oSqlServer As SQLServer2, ByVal intDatabaseIndex As Integer) As SQLDMO.UserDefinedFunctions oSqlServer.Databases.Item (intDatabaseIndex). 'There is no method that returns the UDF collectionEnd FunctionThanks in advance.Rajender Kr. |
|
|
robvolk
Most Valuable Yak
15732 Posts |
Posted - 2005-05-11 : 08:16:46
|
| Funny, I found a UserDefinedFunctions collection in Books Online. |
 |
|
|
rajender
Starting Member
13 Posts |
Posted - 2005-05-11 : 08:37:27
|
| RobVolk try thisPublic Function UserDefinedFunctions(ByVal oSqlServer As SQLServer2, ByVal intDatabaseIndex As Integer) As SQLDMO.UserDefinedFunctions Dim xDb As New SQLDMO.Database Dim xUdf As SQLDMO.UserDefinedFunctions Set xDb = oSqlServer.Databases.Item(intDatabaseIndex) Set xUdf = xDb. 'At this point i don't find any methodEnd FunctionMay be i am doing something wrong.Rajender Kr. |
 |
|
|
robvolk
Most Valuable Yak
15732 Posts |
Posted - 2005-05-11 : 09:51:28
|
| I'd suggest looking in Books Online, they'll have an example in there. |
 |
|
|
|
|
|