treeview of Italy

User avatar
sal21
PlatinumLounger
Posts: 4497
Joined: 26 Apr 2010, 17:36

treeview of Italy

Post by sal21 »

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
You do not have the required permissions to view the files attached to this post.

User avatar
HansV
Administrator
Posts: 79447
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: treeview of Italy

Post by HansV »

Best wishes,
Hans

User avatar
sal21
PlatinumLounger
Posts: 4497
Joined: 26 Apr 2010, 17:36

Re: treeview of Italy

Post by sal21 »

HansV wrote:
30 Sep 2023, 16:51
See treeview with database access
!!!! 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?

User avatar
HansV
Administrator
Posts: 79447
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: treeview of Italy

Post by HansV »

I don't You might use the GetRows method of the recordset to read the records into an array

Code: Select all

    Dim myArray
    myArray = RST.GetRows
but you'd have to test for yourself if it improves the speed of execution.
Best wishes,
Hans

User avatar
sal21
PlatinumLounger
Posts: 4497
Joined: 26 Apr 2010, 17:36

Re: treeview of Italy

Post by sal21 »

HansV wrote:
30 Sep 2023, 18:16
I don't You might use the GetRows method of the recordset to read the records into an array

Code: Select all

    Dim myArray
    myArray = RST.GetRows
but you'd have to test for yourself if it improves the speed of execution.
Infact tomorrow i test GetRows.

User avatar
SpeakEasy
5StarLounger
Posts: 616
Joined: 27 Jun 2021, 10:46

Re: treeview of Italy

Post by SpeakEasy »

Aha - back to testing, eh? Does this mean you'll be able to test the string decryption code from 10 days ago as well?

User avatar
sal21
PlatinumLounger
Posts: 4497
Joined: 26 Apr 2010, 17:36

Re: treeview of Italy

Post by sal21 »

SpeakEasy wrote:
01 Oct 2023, 11:29
Aha - back to testing, eh? Does this mean you'll be able to test the string decryption code from 10 days ago as well?
SORRY i can test only now.

snb
5StarLounger
Posts: 614
Joined: 14 Nov 2012, 16:06

Re: treeview of Italy

Post by snb »

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.
You do not have the required permissions to view the files attached to this post.