|
I am having a problem that some of you guys may have encountered before.
I have my database table having a "Menu_id" field which is used for the javascript of showing the popup menus and i need a alternative way of querying the database and displaying the code and if the menu_id is different start over. The code i have right now is
<% db_PATH = "D:\Inetpub\wwwroot\Sky-WorldForum\pchoops-com\database\pchoops.mdb" '-------------------------------------------------------------- Set db_CON = Server.CreateObject("ADOdb.CONnection") db_CON.Open "DRIVER={Microsoft Access Driver (*.mdb)}; dbQ=" & db_PATH Set db_RS = Server.CreateObject("ADOdb.Recordset") db_SQL = "select * from teampages where school='" & schoolid & "' and menu_id='JHcb34e555z45azerffx3xeg4r'" db_RS.CuRSorType = 2 db_RS.LockType = 3 db_RS.Open db_SQL, db_CON %>
<% if not db_rs.eof then startsubmenu("JHcb34e555z45azerffx3xeg4r") while not db_rs.eof submenu db_RS("title"), domain & script_name & "?sid=" & schoolid & "&spid=" & db_RS("id") db_RS.movenext wend endsubmenu() else startsubmenu("JHcb34e555z45azerffx3xeg4r") submenu "No Content Published", "#" endsubmenu() end if
%>
where i specified the menu_id is what needs to be changed each time and the "JHcb34e555z45azerffx3xeg4r" is one of the menu ids, Pretty much i made 5 of the above with different menu_id's
Please help me on this one its been bugging me for a while now since the code works but i cant find another efficient way that wont most likely crash in the end
|