|
|
|
|
|
| | |
|
Active Server Pages help tutorial how to ASP Help ASP Tutorials ASP Programming ASP Code - ASP Free CJWSoft ASPProtect ASPBanner ASPClassifieds
(Advanced)
(Components)
(Database)
(General)
(Vbscript)

|
|
Subject: |
Re: Find out table names with ASP? |
From: |
Kevin |
Date: |
2/22/2001 10:31:57 AM |
IP: |
198.166.214.4 |
Hi Jane,
I'll assume you have at least the server name, db, uid and pasword for the db. If so you could try this...
<%
Dim aServer
Dim aServerName
Dim aDatabaseName
Dim aUid
Dim aPassword
Dim aSQLdb
Set aServer = Server.CreatObject("sqlole.sqlserver")
aServerName = "Your Server Name"
aUid = "Your Id"
aPassword = "Your Password"
aServer.Connect aServerName, aUid, aPassword
aDatabaseName = "Your Database Name"
%>
<SELECT NAME = "Table Names" SIZE = "1">
<%Set aSQLdb = aServer.Database(aDatabaseName)
For Each aSQLTable in aSQLdb.Tables
Response.Write "<option values = """ & aSQLTable.Name & """>" & aSQLTable.Name & "</option>
Next
%>
</SELECT>
|
Previous Message
|
|
|
|
|
|
|
|
|
|
|
|