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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

An Easy Question 1

Status
Not open for further replies.

iliasKBS

Programmer
Apr 17, 2003
4
GB
I am a new VB programmer and I am conencting to mySQL server via DAO and mySQL ODBC connector. Is there direct way to retrieve the table and fields names? mySQL does not support the adSchemaColums property to give me the fields names in one pass. I saw a code where the schema for the fields is retrieved in a two way procedure. But i am getting reslts if i do TWO connections. One to get the table , and a second to get is fields:

Set someTables = someConnection.OpenSchema(adSchemaTables)

Set someFields = someConnection.OpenSchema(adSchemaColumns,Array(Empty, Empty, someTables("TABLE_NAME").Value,Empty))

AND THIS IS SLOW!! The driver re-eastablishes connection for every table I am asking fields.
 
"SHOW TABLES" will give you a list of tables in the currently-selected database.

Issuing the query "DESCRIBE tablename" or "SHOW COLUMNS FROM tablename" will get you a list and description of columns of a table



Want the best answers? Ask the best questions: TANSTAAFL!
 
how do you display all the databases?
from the command prompt.
 
sleipnir,

Good clear, simple answer.

I gave you a S T A R !!!

BTW: Congratulations getting to be the top poster for the week!



tgus

____________________________
Families can be together forever...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top