my problem is that i dont know how to get all tables in an listmenu displayed ?? after that i want to choose a table and the table or some specific rows are displayed.
??can somebody help out with that??
caz [sig][/sig]
I am not sure what you but below is how I understood you.
Are you accessing SQL Server or some other database? If you are using SQL Server than in order to get list of all the table in your list box you would say
SELECT [name]
FROM myDatabase..sysobjects
WHERE xtype= 'U' AND status >= 0
ORDER BY [name]
and if you are accessing MS Access you would say
SELECT [Name]
FROM MSysObjects
WHERE Type = 1 AND [Name] NOT LIKE "MSys*"
ORDER BY [Name]
Type=1 are Access tables, Type=4 are linked tables, Type=3 are Queries Type=-32764 are Reports.
OK, now this is a rough sample. It works through SQL Server
<%
sql = "SELECT [name] FROM myDatabase..sysobjects "
sql = sql + "WHERE xtype= 'U' AND status >= 0 "
sql = sql + "ORDER BY [name]"
set conn = Server.CreateObject("ADODB.Connection"
'The following is all in one line
conn.Open "Provider=SQLOLEDB.1;Data Source="+ Request.ServerVariables("SERVER_NAME"+";User ID=uID;Password=pwd;Initial Catalog=<database name>;"
set rs =conn.Execute(sql)
%>
Now you will create a listbox and under the <SELECT ...></SELECT> make sure that the recordset is not empty rs.EOF = False and populate the listbox. The code is too big to write it. [sig][/sig]
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.