speed uo to read rset from SQL Express

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • sal21
    New Member
    • Jun 2006
    • 28

    speed uo to read rset from SQL Express

    i use ths qery to read rset from sql Express and populate a treeview...
    But really the operation is very slow...!!!!

    this is a part of code:
    \\\\\\\\\\\\\\\ \\\
    'CNSQL.Open "Provider= SQLOLEDB.1; Integrated Security=SSPI;P ersist Security Info=False;Inti tial Catalog=TEST_DB _PAST_DUE;Data Source=MY-F0D2D0395FFE\SQ LEXPRESS;"
    \\\\\\\\\\\\\\\ \\\\\

    Code:
        With FORM_TREEVIEW_.TreeView1
    
            'ADOOpenRecordSet SSQL
    
            Call setUpListView
            Set RSSQL2 = CNSQL.Execute("Query1")    ', adOpenForwardOnly, adLockReadOnly
            'CNSQL.Execute ("Query1"), adOpenForwardOnly, adLockReadOnly
    
           RSSQL2.CursorLocation = adUseServer
            RSSQL2.MoveFirst
            Do Until RSSQL2.EOF
                sValue = Trim(RSSQL2.Fields("COD_AREA").value)
                sKey = "K" & sValue
                .Nodes.Add , , sKey, sValue & " - " & Trim(RSSQL2.Fields("DESCRIZIONE")), 1, 1
                'Debug.Print sValue & " - " & Trim(RSSQL2.Fields("DESCRIZIONE"))
                sValue = Trim(RSSQL2.Fields("SPORT").value)
                'sSQL = .Nodes.Count
                'Z = Z + 1
                .Nodes.Add sKey, tvwChild, "L" & sValue, sValue & " - " & Trim(RSSQL2.Fields("DESCRIZIONE2")), 1, 2
                sKey = "L" & sValue
                sValue = Trim(RSSQL2.Fields("PROVA3"))
                'sSQL = .Nodes.Count
                .Nodes.Add sKey, tvwChild, "M" & sKey & sValue, sValue, 1, 2
                sKey = "M" & sKey & sValue
                sValue = "COPE - " & Trim(RSSQL2.Fields("PROVA1"))
                .Nodes.Add sKey, tvwChild, "N" & sValue, sValue, 1, 2
                '.Nodes.Item(sKey).EnsureVisible
                RSSQL2.MoveNext
                'sSQL = .Nodes.Count
            Loop
        End With
  • ck9663
    Recognized Expert Specialist
    • Jun 2007
    • 2878

    #2
    Run your query in SQL Analyzer. Try to see if it runs to your satisfaction. If it did, then your problem is on your front-end, which looks like a .Net

    -- CK

    Comment

    Working...