Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

OleDbSchema ... Possible to get type of "View/Query" ? 1

Status
Not open for further replies.

ZmrAbdulla

Technical User
Apr 22, 2003
4,364
AE
I am trying to get details of an Access DB thorugh "OleDbSchema".
Code:
DB_Connection.GetOleDbSchemaTable(OleDbSchemaGuid.Tables, _
       New Object() {Nothing, Nothing, Nothing, "VIEW"})
Is that possible to get type of Query(View) through this?

I need to know what type of query is that (Select/Delete/Update/Union etc..)

Thanks

________________________________________________________
Zameer Abdulla
Help to find Missing people
 
If I remember well, this "GetOleDbSchemaTable" returns a table with several columns, one of wich contains the sql text of the query. You can check whether this text starts with "SELECT " or "DELETE " or "UPDATE " or if it contains a " UNION SELECT " etc ....

Hope this helps somehow.

---
[tt][COLOR=white Black]MASTA[/color][COLOR=Black lightgrey]KILLA[/color][/tt] [pipe]
 
I can't find any column contains SQL text though it returns 14 columns.
TABLE_CATOLG
TABLE_SCHEMA
TABLE_NAME
TABLE_TYPE
TABLE_GUID
BOOKMARKS
etc...

can you please make sure it has

________________________________________________________
Zameer Abdulla
Help to find Missing people
 
I think I need to query system tables to find out..
I will try it tomorrow. time to leave now.

________________________________________________________
Zameer Abdulla
Help to find Missing people
 
OK,

try this then:

Code:
DB_Connection.GetOleDbSchemaTable(OleDb.OleDbSchemaGuid.Views, _
       New Object() {Nothing, Nothing, Nothing})

It will return a table with the views' information, check out column VIEW_DEFINITION. I can already see the big happy smile on your face ! [wink]

---
[tt][COLOR=white Black]MASTA[/color][COLOR=Black lightgrey]KILLA[/color][/tt] [pipe]
 
Excellent..

But..Queries other than SELECT won't be shown in the list.


________________________________________________________
Zameer Abdulla
Help to find Missing people
 
Found it..
Code:
DB_Connection.GetOleDbSchemaTable(OleDbSchemaGuid.[COLOR=red][b]Procedures[/b][/color], _
         New Object() {Nothing, Nothing, Nothing})

________________________________________________________
Zameer Abdulla
Help to find Missing people
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top