If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ASP > Drop down menu

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 04-13-06, 12:30
dimis2500 dimis2500 is offline
Registered User
 
Join Date: Jan 2005
Posts: 362
Drop down menu

I want to create with asp a "menu" that will have a dynamicall drop down menu.
Is there any ready drop down or a tutorial for this?
Thank you
dimis
Reply With Quote
  #2 (permalink)  
Old 04-20-06, 16:26
csamuels csamuels is offline
Registered User
 
Join Date: Mar 2006
Location: south jersey, usa
Posts: 53
this script gives me a list of users from a application's sql database

Code:
dim srs
  sqlserver = request.form("db") 'get database name from input
  sqluser = request.form("user") 'get sql user from input
  sqlpwd = request.form("pass") 'get sql pwd from input
  sqldb = request.form("dbname") 'get db name from input
  set sconn = CreateObject("ADODB.Connection") 'prep connection to sql 
  set srs = CreateObject("ADODB.Recordset") 'prep recordset for login names
  sconn.open "PROVIDER=SQLOLEDB;DATA SOURCE=" & sqlserver & ";UID=" & sqluser &_
             ";PWD=" & sqlpwd & ";DATABASE=" & sqldb 'connect to sql 
query = "select loginname from irsysusers where status = 12 order by loginname"
  srs.open query, sconn
  if srs.eof then 
    response.write "NO USERS FOUND IN DATABASE, CONTACT SYSTEMS DEPT"
  else 
    response.write "<select name=iruser><OPTION VALUE='%'>ALL USERS</OPTION>"
    do until srs.eof 
      response.write "<option>" & srs.fields("loginname") & "</option>" 
      srs.movenext 
    loop
    response.write "</select><br><br><input type=submit value='Get Rights'></form>" 
  end if
  srs.close     
  sconn.close
__________________
"They say Moses split the Red Sea
I split the blunt and rolled the fat one, I'm deadly"
-- Tupac 'Blasphemy'
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On