|
-
September 18th, 2001, 11:33 PM
#1
using string in database field
I store a line of string (0011..) in a filed in Access Database. I want to retrieve this field and to store it in an array which array1(1)=0, array1(2)=0 array1(3)=1 and so on... And after that, I will make a comparison between two array, array1 and array2.
What must I do?
Thank You
-
September 19th, 2001, 01:31 AM
#2
Re: using string in database field
You can use the strConv function to get an array.
arr1 = StrConv(strLine1, vbToUnicode)
arr2 = StrConv(strLine2, vbToUnicode)
This gives you a byte array however, so the values are numeric instead of string, but that doesn't matter when comparing
for T=0 to Ubound(arr1)
If arr1(t) = arr2(t) then
Match = Match + 1
End If
Msgbox round((match / ubound(arr1) * 100) ,2) & "% of the arrays match"
next T
Tom Cannaerts
[email protected]
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the universe trying to produce bigger and better idiots. So far, the universe is winning -- Rich Cook
-
September 19th, 2001, 08:22 PM
#3
Re: using string in database field
Thank You for that.But, I'm will retrieve the data from the field in database and put it in array befaore compare it.
-
September 20th, 2001, 01:04 AM
#4
Re: using string in database field
Well, what I used were just plain strings, so if you get the data from the database into the strings, you're done
strLine1 = rst("SomeField")
strLine2 = rst("SomeOtherField")
Tom Cannaerts
[email protected]
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the universe trying to produce bigger and better idiots. So far, the universe is winning -- Rich Cook
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|