an example please..
?
Everything you need to know is covered in these articles, especially if you
supplement the SQL Server examples with some reading in SQL Books Online.
For example, for SQL Server, here's a copy-paste from the aspfaq article
(with a slight modification to eliminate the dynamic sql, and another
modification to show all the field values of the returned recordset):
<%
dbname = "databasename"
tablename = "tablename"
ConnStr = "Provider=SQLOLEDB; Network=DBMSSOCN;" & _
"Data Source=<x.x.x.x>;" & _
"User Id=<uid>; Password=<pwd>;" & _
"Initial Catalog=" & dbname
set adodbConn = CreateObject("ADODB.Connection")
adodbConn.Open ConnStr
set rs = CreateObject("ADODB.Recordset")
rs.cursorlocation = 3 'adUseClient
adodbConn.sp_columns tablename,rs
set rs.activeconnection = nothing
adodbConn.Close: set adodbConn = nothing
Response.Write "<TABLE><TR>"
for each fld in rs.Fields
Response.Write "<TD>" & fld.name & "</TD>"
next
Response.Write "</TR><TD>"
str = rs.GetString(2,,"</TD><TD>","</TD></TR><TR><TD>"," ")
rs.close: set rs = nothing
str=left(str,len(str)-8)
response.write str
response.write "</TABLE>"
%>
Substitute your specific information, run this code and look at the
COLUMN_DEF field.
For Access, it is a little harder.
Actually, come to think of it, you may be able to use OpenSchema for all of
your databases. Try this:
<%
dbname = "databasename"
tablename = "tablename"
ConnStr = "Provider=SQLOLEDB; Network=DBMSSOCN;" & _
"Data Source=<x.x.x.x>;" & _
"User Id=<uid>; Password=<pwd>;" & _
"Initial Catalog=" & dbname
set adodbConn = CreateObject("ADODB.Connection")
adodbConn.Open ConnStr
set rs = adodbConn.OpenSchema(adSchemaColumns, _
Array(Empty,Empty,tablename))
Response.Write "<TABLE border=1><TR>"
for each fld in rs.Fields
Response.Write "<TD>" & fld.name & "</TD>"
next
Response.Write "</TR><TD>"
str = rs.GetString(2,,"</TD><TD>","</TD></TR><TR><TD>"," ")
rs.close: set rs = nothing
adodbConn.Close: set adodbConn = nothing
str=left(str,len(str)-8)
response.write str
response.write "</TABLE>"
%>
You can make this return information about a specific column by changing
this:
set rs = adodbConn.OpenSchema(adSchemaColumns, _
Array(Empty,Empty,tablename))
to this:
col = "SomeColumn"
set rs = adodbConn.OpenSchema(adSchemaColumns, _
Array(Empty,Empty,tablename, col))
This workd with both SQL Server and Jet. I don't know if it will work with
MySQL, but i suspect that it will.
Bob Barrows
> an example please..

Signature
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
Lex Luthor - 26 Jan 2005 15:29 GMT
i must get a key name with a simple query
as select @@identity that response key value but not key name
> ?
> Everything you need to know is covered in these articles, especially if you
[quoted text clipped - 81 lines]
>
> > an example please..
Bob Barrows [MVP] - 26 Jan 2005 17:10 GMT
> i must get a key name with a simple query
> as select @@identity that response key value but not key name
I do not have a clue as to what you are talking about. Anyone else?
Bob Barrows

Signature
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
Roland Hall - 26 Jan 2005 17:46 GMT
: > i must get a key name with a simple query
: > as select @@identity that response key value but not key name
: >
: I do not have a clue as to what you are talking about. Anyone else?
Ya'. It sounds like you don't have a clue. (O:=.

Signature
Roland Hall
/* This information is distributed in the hope that it will be useful, but
without any warranty; without even the implied warranty of merchantability
or fitness for a particular purpose. */
Technet Script Center - http://www.microsoft.com/technet/scriptcenter/
WSH 5.6 Documentation - http://msdn.microsoft.com/downloads/list/webdev.asp
MSDN Library - http://msdn.microsoft.com/library/default.asp
Lex Luthor - 27 Jan 2005 08:22 GMT
i want to know the field name as "select @@identity" value.. the last
>> i must get a key name with a simple query
>> as select @@identity that response key value but not key name
>>
> I do not have a clue as to what you are talking about. Anyone else?
>
> Bob Barrows