|
-
Oct 21st, 2000, 08:40 AM
#1
Thread Starter
Hyperactive Member
HI,
I'm basing this on what I'd do using VB. How do I get a list of fields in a table in the database using vbscript in ASP?
Code that doesn't work:
<%
Dim Connect, Query, tmst, SQLstr, varName
Set Connect = Server.CreateObject("ADODB.Connection")
Connect.Open "NewSite"
SQLstr = "Select * from Tracking"
Set Query = Connect.Execute (SQLstr)
%>
<Table>
<tr>
<td> <%=Query.TableDefs.Count - 1%>
</table>
Thanks
-
Oct 21st, 2000, 08:56 AM
#2
Thread Starter
Hyperactive Member
OOPS!
I guess I didn't think enough before asking that one, sorry.
I figured it out. This code works:
<%
Dim Connect, Query, tmst, SQLstr, varName
Set Connect = Server.CreateObject("ADODB.Connection")
Connect.Open "NewSite"
SQLstr = "Select * from Tracking"
Set Query = Connect.Execute (SQLstr)
%>
<Table>
<BR><%For tableCount = 0 to Query.Fields.Count - 1%>
<BR> <%= Query.Fields(tableCount).name%>
<BR><%Next%>
<BR>
<BR>
</table>
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|