Home > ASP Development > how to get table names from mdb for menu

how to get table names from mdb for menu



HI



i want to make a drop down menu with the names of the tables in the mdb.



how do i get this right? do i use a sql statement? i cannot

find a sql statement with the command for this.



thanks

Shem

    
Guest


Hi Shem,

try this query:


Code:



sql = "SELECT MSysObjects.Name FROM MsysObjects WHERE (Left$([Name],1)<>""~"") AND (Left$([Name],4) <> ""Msys"") AND (MSysObjects.Type)=1 ORDER BY MSysObjects.Name"
rs.Open sql, conn

while not rs.EOF
response.write rs("MSysObjects.Name") & "<br/>"
rs.moveNext
wend




hope this helps

Was this answer helpful ? Yes No   
Guest


can you explain wots going on in that sql, just so i understand what it that i'm doing, if ya don't mind.



ps. saturday dawn patrol, seems the SE is gona pick up early in the day

Was this answer helpful ? Yes No   
Guest


the MsysObjects is a table that holds everything from you access, forms/ tables/ reports

so it selects everything from that table, the criteria(WHERE CLAUSE) is to ensure that

only user defined tables come out and not the system objects too.



Hope that makes it a bit clearer





I am going to stellenbosch 2nite, dont think I'll make it for a dawnie Maybe late afternoon, wind should have died a bit by then

Was this answer helpful ? Yes No   
Guest


Record(s) cannot be read; no read permission on 'MsysObjects'.



does this just mean that i dnt have read permissions on my mdb?

Was this answer helpful ? Yes No   
Guest


just make sure that you have full permission on your database, I just ran it directly in access to check and it works weird...

Was this answer helpful ? Yes No   
Guest
 
 
Home - About Infoqu - Contact - Privacy Statement - Link to Infoqu - Bookmark Infoqu

Copyright 2007-2008 by Infoqu. All rights reserved