472,326 Members | 1,688 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,326 software developers and data experts.

Getting cloumn names

164 100+
Hi all

Am using asp and mysql...

I have to fetch columns from mysql database..

In jsp there is an option to get the column names directly by using getColumnName(ih)

And how to use this in asp like getColumnName(ih) in jsp...

I want to use that same in asp...

Give me some hints..
Am using request.form for each and every values...

Thanx
Apr 11 '07 #1
1 1337
If you use ADODB to connect to your MySQL database, then you could use the following code to achieve this:

Expand|Select|Wrap|Line Numbers
  1. Sub ListTableAndColumnNamesADO()
  2.   Dim Conn As New ADODB.Connection
  3.   Dim TablesSchema As ADODB.Recordset
  4.   Dim ColumnsSchema As ADODB.Recordset
  5.  
  6.   'Open connection you want To get database objects
  7.   Conn.Provider = "MSDASQL"
  8.   Conn.Open "DSN=...;Database=...;", "UID", "PWD"
  9.  
  10.   'Get all database tables.
  11.   Set TablesSchema = Conn.OpenSchema(adSchemaTables) 
  12.   Do While Not TablesSchema.EOF
  13.     'Get all table columns.
  14.     Set ColumnsSchema = Conn.OpenSchema(adSchemaColumns, _
  15.       Array(Empty, Empty, "" & TablesSchema("TABLE_NAME")))
  16.     Do While Not ColumnsSchema.EOF
  17.       Debug.Print TablesSchema("TABLE_NAME") & ", " & _
  18.         ColumnsSchema("COLUMN_NAME")
  19.       ColumnsSchema.MoveNext
  20.     Loop
  21.     TablesSchema.MoveNext
  22.   Loop
  23. End Sub
Apr 12 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

15
by: Aaron Gray | last post by:
<iframe name="iframe" width="100%" height="25%" src="test1.txt"> </iframe> <a href="test1.txt" target="input">one</a> <a href="test2.txt"...
1
by: Bruce Wood | last post by:
I'm having a devil of a time calling DeviceCapabilities() in order to get the list of paper names / codes / sizes for a printer. Here is my code...
1
by: Naveen Mukkelli | last post by:
Hi, I've got 3 Network Interface Cards(NIC) in my PC. Lets say NIC1, NIC2, NIC3. I have openend network connections in control panel and renamed...
1
by: farseer | last post by:
Hi, I created a new resouce ("app.resx") in my project and added an icon to this resource with name "IL_ICON". I would like to use this resource...
20
by: Shawnk | last post by:
I would like to get the class INSTANCE name (not type name) of an 'object'. I can get the object (l_obj_ref.GetType()) and then get the...
4
by: none | last post by:
Hi, I am wondering if anyone has some insight into a way to get the names of the functions that are defined in a C header file. What I am trying...
10
by: Rahul Babbar | last post by:
Hi, I am getting the following error, while executing the simple insert script on a few tables. INSERT INTO <table_name>(<col1>) VALUES (1); ...
4
by: Joseph | last post by:
Can i drop a cloumn from a table in DB2 for Z/OS?
3
by: koti688 | last post by:
how to get the column names and the values of them in select statment. I have a packaze like this named ADB.pm package ADB; use DBI; ...
0
by: tammygombez | last post by:
Hey everyone! I've been researching gaming laptops lately, and I must say, they can get pretty expensive. However, I've come across some great...
0
by: concettolabs | last post by:
In today's business world, businesses are increasingly turning to PowerApps to develop custom business applications. PowerApps is a powerful tool...
0
better678
by: better678 | last post by:
Question: Discuss your understanding of the Java platform. Is the statement "Java is interpreted" correct? Answer: Java is an object-oriented...
0
by: teenabhardwaj | last post by:
How would one discover a valid source for learning news, comfort, and help for engineering designs? Covering through piles of books takes a lot of...
0
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and...
0
by: CD Tom | last post by:
This happens in runtime 2013 and 2016. When a report is run and then closed a toolbar shows up and the only way to get it to go away is to right...
0
by: CD Tom | last post by:
This only shows up in access runtime. When a user select a report from my report menu when they close the report they get a menu I've called Add-ins...
0
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge...
0
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.