|
Subject:
|
SQL Stored Procedure & VB6
|
|
Posted By:
|
acdsky
|
Post Date:
|
5/17/2004 5:29:18 AM
|
Hi
I need to get a list of DB's, Tables and Fields from a VB6 app. I know that in SQL there are standard stored procedures that will return this data (sp_HelpDB, sp_tables and sp_columns)
My problem is how do I excecute these from VB6 And get the results back into the app? Or is there a better way to do this?
|
|
Reply By:
|
Lalit_Pratihari
|
Reply Date:
|
9/29/2004 10:01:55 AM
|
Hi,
Yes you can do it through VB6 App.
To get a list of databases name you can use this query:
SELECT * FROM MASTER.DBO.SYSDATABASES
And to get a list of tables and columns you can use this query:
SELECT * FROM INFORMATION_SCHEMA.TABLES IT INNER JOIN INFORMATION_SCHEMA.COLUMNS IC ON IT.TABLE_NAME = IC.TABLE_NAME WHERE IT.TABLE_TYPE = 'BASE TABLE'
Hope this helps,
Lalit Life Means More...
|