By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,856 Members | 2,179 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,856 IT Pros & Developers. It's quick & easy.

speed uo to read rset from SQL Express

P: 18
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;Persist Security Info=False;Intitial Catalog=TEST_DB_PAST_DUE;Data Source=MY-F0D2D0395FFE\SQLEXPRESS;"
\\\\\\\\\\\\\\\\\\\\

Expand|Select|Wrap|Line Numbers
  1.  
  2.     With FORM_TREEVIEW_.TreeView1
  3.  
  4.         'ADOOpenRecordSet SSQL
  5.  
  6.         Call setUpListView
  7.         Set RSSQL2 = CNSQL.Execute("Query1")    ', adOpenForwardOnly, adLockReadOnly
  8.         'CNSQL.Execute ("Query1"), adOpenForwardOnly, adLockReadOnly
  9.  
  10.        RSSQL2.CursorLocation = adUseServer
  11.         RSSQL2.MoveFirst
  12.         Do Until RSSQL2.EOF
  13.             sValue = Trim(RSSQL2.Fields("COD_AREA").value)
  14.             sKey = "K" & sValue
  15.             .Nodes.Add , , sKey, sValue & " - " & Trim(RSSQL2.Fields("DESCRIZIONE")), 1, 1
  16.             'Debug.Print sValue & " - " & Trim(RSSQL2.Fields("DESCRIZIONE"))
  17.             sValue = Trim(RSSQL2.Fields("SPORT").value)
  18.             'sSQL = .Nodes.Count
  19.             'Z = Z + 1
  20.             .Nodes.Add sKey, tvwChild, "L" & sValue, sValue & " - " & Trim(RSSQL2.Fields("DESCRIZIONE2")), 1, 2
  21.             sKey = "L" & sValue
  22.             sValue = Trim(RSSQL2.Fields("PROVA3"))
  23.             'sSQL = .Nodes.Count
  24.             .Nodes.Add sKey, tvwChild, "M" & sKey & sValue, sValue, 1, 2
  25.             sKey = "M" & sKey & sValue
  26.             sValue = "COPE - " & Trim(RSSQL2.Fields("PROVA1"))
  27.             .Nodes.Add sKey, tvwChild, "N" & sValue, sValue, 1, 2
  28.             '.Nodes.Item(sKey).EnsureVisible
  29.             RSSQL2.MoveNext
  30.             'sSQL = .Nodes.Count
  31.         Loop
  32.     End With
  33.  
  34.  
Feb 1 '09 #1
Share this Question
Share on Google+
1 Reply


ck9663
Expert 2.5K+
P: 2,878
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
Feb 1 '09 #2

Post your reply

Sign in to post your reply or Sign up for a free account.