Wrox Programmer Forums
|
VB Databases Basics Beginning-level VB coding questions specific to using VB with databases. Issues not specific to database use will be redirected to other forums.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VB Databases Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old May 17th, 2004, 05:29 AM
Friend of Wrox
 
Join Date: Nov 2003
Posts: 141
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to acdsky
Default SQL Stored Procedure & VB6

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?
 
Old September 29th, 2004, 10:01 AM
Authorized User
 
Join Date: Sep 2004
Posts: 55
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to Lalit_Pratihari
Default

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...;)





Similar Threads
Thread Thread Starter Forum Replies Last Post
VB & SQL stored procedure garaxan VB How-To 1 September 4th, 2007 11:08 AM
Dataset & Stored Procedure Problem clioz BOOK: Professional Crystal Reports for VS.NET 0 July 21st, 2006 07:42 PM
ASP.NET & SQL Server 2K Stored Procedure kwilliams ASP.NET 2.0 Basics 7 May 10th, 2006 12:55 AM
How to call a Oracle Stored Procedure in VB6 krratnesh Pro VB Databases 1 February 19th, 2006 11:56 AM
To call oracle stored procedure in vb6 krratnesh Pro VB 6 0 February 1st, 2006 10:26 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.