CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3

Thread: Vb Script ASP

  1. #1
    Join Date
    Aug 1999
    Location
    Srilanka
    Posts
    25

    Vb Script ASP

    I am using visual interdev and vb script for ASP programming...When I use a design time control drop down list box(Combo Box) on the ASP page from the Interdev toolbox.I have about 900 records in a(SQL Server database) table and have assigned a field to the list box and it takes a long time for the page to load it in the browser.Please I want a solution to lessen the time


  2. #2
    Guest

    Re: Vb Script ASP

    Hello,

    if you are using ADO for this, then try by OLEDB provider for SQL Server your performance will automatically get better.

    otherwise use disconnected recordset.

    Best of Luck
    if your problem does not get solved by this along with performance.

    then reply me at :

    [email protected]





  3. #3
    Join Date
    Jan 2000
    Location
    MO, USA
    Posts
    1,506

    Re: Vb Script ASP

    your probably better off not "binding" the combo box across the web. just manually get the recordset and in a loop build the html to build the combo box. it couldn't hurt.

    Sub FillCombo()
    dim sql
    dim rs
    dim cn
    dim str

    set cn = server.createobject("adodb.connection")
    set rs = server.createobject("adodb.recordset")

    cn.open sConnectionString

    sql = "SELECT Field1 FROM database..table (nolock) WHERE blah = stuff"

    set rs = cn.execute(sql)

    if not rs.eof then
    str = "<select name='MyName'>"

    while not rs.eof
    str = str & "<option value='" & rs(0) & "'>" & rs(0) & "</option>" & vbcrlf
    rs.movenext
    wend

    rs.close
    end if

    set rs = nothing
    cn.close
    set cn = nothing

    response.write str




    that will build a drop down box of all records in your table. it will send the html down to the browser pretty, once it's there, it's up to the browser to interprit the html and build the visual objects.

    hope this helps,
    john

    John Pirkey
    MCSD
    www.ShallowWaterSystems.com
    John Pirkey
    MCSD (VB6)
    http://www.stlvbug.org

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured