Using Access 2003, the following snipset produces 3.628.800 records.
It is actually a permutation procedure, in this example, call GRListWords("", "ABBREVIATE", 10) 10 letters to form all possible words in groups of 10 letters.
My problem is that I can not get them into a table - execution holds and get the message "Not responding".
Even-more, the same happens when I use Debug.Print from the immediate window!
I should also note that it never runs to more than 20K-30K records...
Can somebody figure a way to create this data table?
I've heard about the Dictionary Object, anybody with enough experience to help me out?
Thank you in advance!
It is actually a permutation procedure, in this example, call GRListWords("", "ABBREVIATE", 10) 10 letters to form all possible words in groups of 10 letters.
My problem is that I can not get them into a table - execution holds and get the message "Not responding".
Even-more, the same happens when I use Debug.Print from the immediate window!
I should also note that it never runs to more than 20K-30K records...
Can somebody figure a way to create this data table?
I've heard about the Dictionary Object, anybody with enough experience to help me out?
Thank you in advance!
Code:
Public Function GRListWords(Partial As String, myLetters As String, intLetPerWord As Integer)
''i.e. call GRListWords("", "ABBREVIATE", 10)
Dim I As Integer
Dim Result As String
Dim rs As DAO.Recordset
Dim strSQL As String
strSQL = "Select * from tblGRwords order by GRword"
Set rs = CurrentDb.OpenRecordset(strSQL, dbOpenDynaset)
'Delete content of table
'CurrentDb.Execute "Delete * from tblGRwords"
For I = 1 To Len(myLetters)
Result = Partial & Mid(myLetters, I, 1)
If Len(Result) < intLetPerWord Then
GRListWords Result, Left(myLetters, I - 1) & Mid(myLetters, I + 1), intLetPerWord
Else
'Debug.Print Result
CurrentDb.Execute "INSERT INTO tblGRwords (GRword) Values ('" & Result & "')"
End If
Next I
rs.Close
End Function