| |

VerySource

 Forgot password?
 Register
Search
View: 744|Reply: 2

Can I use Recordset in ADO to get the names of various fields in the database?

[Copy link]

1

Threads

1

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 China

Post time: 2020-3-19 20:00:01
| Show all posts |Read mode
rt
If a SQL statement is used to query a database from a database, is it possible to obtain the table header in this two-dimensional result set from this Recordset, that is, the field name of the corresponding data in the database table?

Please enlighten me heroes!
Greatful!
Reply

Use magic Report

0

Threads

1

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 China

Post time: 2020-6-26 16:45:01
| Show all posts
Don't be so troublesome,
If you use it at the front desk: it can be used like this

select 1 as first column, 2 as second column
from tb
Reply

Use magic Report

0

Threads

211

Posts

108.00

Credits

Newbie

Rank: 1

Credits
108.00

 China

Post time: 2020-6-28 07:15:01
| Show all posts
<%
for i=0 to rs.Fields.Count-1
   response.write rs.fields(i).name
next
%>
Reply

Use magic Report

You have to log in before you can reply Login | Register

Points Rules

Contact us|Archive|Mobile|CopyRight © 2008-2023|verysource.com ( 京ICP备17048824号-1 )

Quick Reply To Top Return to the list