467,077 Members | 954 Online
Bytes | Developer Community
Ask Question

Home New Posts Topics Members FAQ

Post your question to a community of 467,077 developers. It's quick & easy.

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;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
  • viewed: 1826
Share:
1 Reply
ck9663
Expert 2GB
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.

Similar topics

26 posts views Thread by Adrian Parker | last post: by
2 posts views Thread by armin walland | last post: by
52 posts views Thread by Neuruss | last post: by
10 posts views Thread by Ali Chambers | last post: by
17 posts views Thread by Igor | last post: by
2 posts views Thread by rodny.romero@gmail.com | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.