Perhaps just post but not found in my old project, sorry.
attached a database.
I need this structure
+REG-REGIONE
+PR-PROVINCIA
CF-COMUNE
note:
a where clausole in query is on STATO field =A, for only active COMUNE
sorry me
treeview of Italy
-
- PlatinumLounger
- Posts: 4497
- Joined: 26 Apr 2010, 17:36
treeview of Italy
You do not have the required permissions to view the files attached to this post.
-
- Administrator
- Posts: 79447
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
-
- PlatinumLounger
- Posts: 4497
- Joined: 26 Apr 2010, 17:36
Re: treeview of Italy
!!!! Found in my old program 10 minutes ago...
I'm already working on it, I'm at 90%
sorry, bro.
note;
during the loop
Set RST = New ADODB.Recordset
RST.Open SQL, CNN, adOpenForwardOnly, adLockReadOnly ', ActiveConnection:=CNN, Options:=adCmdText
Do While Not RST.EOF
Set CHL = Me.TreeView1.Nodes.Add(Relative:=NOD, Relationship:=tvwChild, Text:=RST(FLD))
If level < UBound(arrLevels) Then
AddChildren CHL, level + 1
End If
RST.MoveNext
Loop
note:
my idea...
i see the code close and set to nothing the recordset, but have and idea to set from the query an array and work with it?
I think you gain a lot in speed or not?
-
- Administrator
- Posts: 79447
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: treeview of Italy
I don't You might use the GetRows method of the recordset to read the records into an array
but you'd have to test for yourself if it improves the speed of execution.
Code: Select all
Dim myArray
myArray = RST.GetRows
Best wishes,
Hans
Hans
-
- PlatinumLounger
- Posts: 4497
- Joined: 26 Apr 2010, 17:36
Re: treeview of Italy
Infact tomorrow i test GetRows.HansV wrote: ↑30 Sep 2023, 18:16I don't You might use the GetRows method of the recordset to read the records into an array
but you'd have to test for yourself if it improves the speed of execution.Code: Select all
Dim myArray myArray = RST.GetRows
-
- 5StarLounger
- Posts: 616
- Joined: 27 Jun 2021, 10:46
Re: treeview of Italy
Aha - back to testing, eh? Does this mean you'll be able to test the string decryption code from 10 days ago as well?
-
- PlatinumLounger
- Posts: 4497
- Joined: 26 Apr 2010, 17:36
-
- 5StarLounger
- Posts: 614
- Joined: 14 Nov 2012, 16:06
Re: treeview of Italy
Where/how did you get the mdb database ?
Save the database as "G:\OF\Italy.mdb"
Open the Excel file.
Adapt the fullpath in variable c00 in the Userform_initialize event of UF_001.
Click the button 'userform' in sheet1.
Save the database as "G:\OF\Italy.mdb"
Open the Excel file.
Adapt the fullpath in variable c00 in the Userform_initialize event of UF_001.
Click the button 'userform' in sheet1.
You do not have the required permissions to view the files attached to this post.