Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Visual Basic > VB 6 Visual Basic 6 > VB Databases Basics
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old May 17th, 2004, 05:29 AM
Friend of Wrox
 
Join Date: Nov 2003
Location: Johannesburg, , South Africa.
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?
Reply With Quote
  #2 (permalink)  
Old September 29th, 2004, 10:01 AM
Authorized User
 
Join Date: Sep 2004
Location: Delhi, Delhi, India.
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...;)
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

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 10:56 AM
To call oracle stored procedure in vb6 krratnesh Pro VB 6 0 February 1st, 2006 09:26 AM



All times are GMT -4. The time now is 02:34 PM.


Powered by vBulletin®
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.