473,396 Members | 2,068 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 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 1354
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" target="input">two</a> <form name="form1"> <textarea...
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 and the input it produces: static extern Int32...
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 them to Network 1, Network 2, Network 3. I'm...
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 in some unmanaged code, in particular, with the...
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 (l_obj_typ.Name) for the class name. I there any way of...
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 to do is develop tests for a large amount of C...
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); DB2 SQL error: SQLCODE: -440, SQLSTATE: 42884,...
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; @ISA = ('Exporter');
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.