Hi,
Use
Microsoft Script Control
Add Microsoft Script Control to your form and name it as
mscr.
Check this code:
-
Dim sSQL As String
-
Dim NewStr As String
-
'
-
sSQL = Join(AsciiArray, ") & Chr(")
-
sSQL = "Chr(" & sSQL
-
sSQL = Left(sSQL, Len(sSQL) - 6)
-
'
-
mscr.AddCode _
-
"Function MyFunction()" & vbCrLf & _
-
" MyFunction = " & sSQL & vbCrLf _
-
& _
-
"End Function"
-
NewStr = mscr.Eval("MyFunction()")
-
-
This works very fast..
Logic here is :
Join all the Ascii Numbers with Chr( ) and Concatenate
and Evaluate the End result with the Script Control.
This worked fine here for 1000 records...
For 2lakh records , if you are getting error, Split the Array into smaller arrays of say 10000 items. find the result of each and Concatenate the end result...
Also Note : AsciiArray should be declared as Datatype =String..(or else JOIN function will err)
Regards
Veena