Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. Still have problems with dropdownlist

Still have problems with dropdownlist

Scheduled Pinned Locked Moved Web Development
databasesysadmin
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    matjame
    wrote on last edited by
    #1

    Hi all. I managed to get this code but cant tell why it doesnt show the results.Its suppose to display the dropdownlist with all the values from the database. <%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%> <% Option Explicit '-- Variables we are using dim objConn, objRS, objRS2, strSQL '-- Define our objects Set objConn = Server.CreateObject("ADODB.Connection") Set objRS = Server.CreateObject("ADODB.Recordset") Set objRS2 = Server.CreateObject("ADODB.Recordset") '-- Database path and Data provider objConn.ConnectionString = Server.MapPath("C:\dropdowns.mdb") objConn.Provider = "Microsoft.Jet.OLEDB.4.0" objConn.Open '-- Sub Procedure that builds the dropdown list Sub showDropDownList(c, r, table) '-- SQL Statement strSQL = "SELECT * FROM " & tblDropDownTest & " ORDER BY Title ASC" '-- Execute our SQL statement and store the recordset Set r = c.Execute(strSQL) '-- If we have records to return if r.eof = false then '-- Open a form/select tag Response.Write "

    " Response.Write "" & vbCrLf Response.Write "Choose...." '-- loop and build each database entry as a selectable option While r.EOF = false Response.Write "" _ & r.Fields("Title").Value & "" & vbCrLf '-- Move recordset to the next value r.movenext Wend else response.write"<"Sorry, no records selected">" end if '-- close select/form tags Response.Write "

    " & vbCrLf End Sub '-- Sub Procedure that builds the dropdown list Sub showDropDownList2(c, r, table) '-- SQL Statement strSQL = "SELECT * FROM " & tblDropDownTest & " ORDER BY Title ASC" '-- Execute our SQL statement and store the recordset r.Open strSQL, c, 3, 3 '-- If we have records to return if r.eof = false then '-- Open a form/select tag Response.Write "

    " Response.Write "" & vbCrLf '-- loop and build each database entry as a selectable option 'filter r.Filter = ("Type = 'fruit'") Response.Write "Choose...." Response.Write "" While r.EOF = false Response.Write "" _ & r.Fields("Title").Value & "" & vbCrLf '-- Move recordset to the next val

    V H 2 Replies Last reply
    0
    • M matjame

      Hi all. I managed to get this code but cant tell why it doesnt show the results.Its suppose to display the dropdownlist with all the values from the database. <%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%> <% Option Explicit '-- Variables we are using dim objConn, objRS, objRS2, strSQL '-- Define our objects Set objConn = Server.CreateObject("ADODB.Connection") Set objRS = Server.CreateObject("ADODB.Recordset") Set objRS2 = Server.CreateObject("ADODB.Recordset") '-- Database path and Data provider objConn.ConnectionString = Server.MapPath("C:\dropdowns.mdb") objConn.Provider = "Microsoft.Jet.OLEDB.4.0" objConn.Open '-- Sub Procedure that builds the dropdown list Sub showDropDownList(c, r, table) '-- SQL Statement strSQL = "SELECT * FROM " & tblDropDownTest & " ORDER BY Title ASC" '-- Execute our SQL statement and store the recordset Set r = c.Execute(strSQL) '-- If we have records to return if r.eof = false then '-- Open a form/select tag Response.Write "

      " Response.Write "" & vbCrLf Response.Write "Choose...." '-- loop and build each database entry as a selectable option While r.EOF = false Response.Write "" _ & r.Fields("Title").Value & "" & vbCrLf '-- Move recordset to the next value r.movenext Wend else response.write"<"Sorry, no records selected">" end if '-- close select/form tags Response.Write "

      " & vbCrLf End Sub '-- Sub Procedure that builds the dropdown list Sub showDropDownList2(c, r, table) '-- SQL Statement strSQL = "SELECT * FROM " & tblDropDownTest & " ORDER BY Title ASC" '-- Execute our SQL statement and store the recordset r.Open strSQL, c, 3, 3 '-- If we have records to return if r.eof = false then '-- Open a form/select tag Response.Write "

      " Response.Write "" & vbCrLf '-- loop and build each database entry as a selectable option 'filter r.Filter = ("Type = 'fruit'") Response.Write "Choose...." Response.Write "" While r.EOF = false Response.Write "" _ & r.Fields("Title").Value & "" & vbCrLf '-- Move recordset to the next val

      V Offline
      V Offline
      Viral Upadhyay
      wrote on last edited by
      #2

      I m not understand wat is your problem is just write wat is the problem not all coding..

      Viral YahooID : just_viral My Site : www.theseoworld.info

      1 Reply Last reply
      0
      • M matjame

        Hi all. I managed to get this code but cant tell why it doesnt show the results.Its suppose to display the dropdownlist with all the values from the database. <%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%> <% Option Explicit '-- Variables we are using dim objConn, objRS, objRS2, strSQL '-- Define our objects Set objConn = Server.CreateObject("ADODB.Connection") Set objRS = Server.CreateObject("ADODB.Recordset") Set objRS2 = Server.CreateObject("ADODB.Recordset") '-- Database path and Data provider objConn.ConnectionString = Server.MapPath("C:\dropdowns.mdb") objConn.Provider = "Microsoft.Jet.OLEDB.4.0" objConn.Open '-- Sub Procedure that builds the dropdown list Sub showDropDownList(c, r, table) '-- SQL Statement strSQL = "SELECT * FROM " & tblDropDownTest & " ORDER BY Title ASC" '-- Execute our SQL statement and store the recordset Set r = c.Execute(strSQL) '-- If we have records to return if r.eof = false then '-- Open a form/select tag Response.Write "

        " Response.Write "" & vbCrLf Response.Write "Choose...." '-- loop and build each database entry as a selectable option While r.EOF = false Response.Write "" _ & r.Fields("Title").Value & "" & vbCrLf '-- Move recordset to the next value r.movenext Wend else response.write"<"Sorry, no records selected">" end if '-- close select/form tags Response.Write "

        " & vbCrLf End Sub '-- Sub Procedure that builds the dropdown list Sub showDropDownList2(c, r, table) '-- SQL Statement strSQL = "SELECT * FROM " & tblDropDownTest & " ORDER BY Title ASC" '-- Execute our SQL statement and store the recordset r.Open strSQL, c, 3, 3 '-- If we have records to return if r.eof = false then '-- Open a form/select tag Response.Write "

        " Response.Write "" & vbCrLf '-- loop and build each database entry as a selectable option 'filter r.Filter = ("Type = 'fruit'") Response.Write "Choose...." Response.Write "" While r.EOF = false Response.Write "" _ & r.Fields("Title").Value & "" & vbCrLf '-- Move recordset to the next val

        H Offline
        H Offline
        hiral_shah
        wrote on last edited by
        #3

        :confused:

        -------------------------------------------------------------------------------------------------- Hiral Shah India

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups