borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder

AndreaVB | Forum | News | Downloads | Register | Help | Member List | Statistics | Search | PM | Profile

Print This Topic
Previous Topic (Too Many Tables)Next Topic (generate reports using VB.Net) New Topic New Poll Post Reply
AndreaVB Forum : Database : String Function needed Solved Topic
Poster Message
niyati
Level: Scholar

Registered: 01-02-2006
Posts: 35

icon String Function needed

Hello Friends,
I am doing a project is visual Basic 6.0.The thing is that i have two database tables.
1)Ques_Table
2)Table_Of_Weightage
Ques_Table contains Four fields
Rem_Grade1
Rem_Grade2
Rem_Grade3
Rem_Redline
Each of these fields consists of medicine names separated by commas.
Eg.
Rem_Grade1   Rem_Grade2   Rem_Grade3
Arn, ars, bry   ang,arn,bapt     Ars

Now the Weighatage table consists of two fields

Rem_Abbr     Rem_Weight
Ars                0
Aeth               0
Calc               0

As you can see above what i am doing is taking the entire string of medicines one by one in a temp variable like this using a recordset

Dim strMed as String
strMed=adoRecQues!Rem_grade1
strMed=adoRecQues!Rem_grade2
strMed=adoRecQues!Rem_grade3
and so on...
then after extracting the entire string of medicines i am first separating the medicines by using a split function

charMed()=Split(strMed,",")

Then after that using an update statement i am supposed to go  to the Table_Of_Weightage and update the Rem_Weight field of each medicine.

Here i am facing a problem with strings.
In the Ques_Table if you notice the starting letter of all medicines is not in capitals,whereas in the Table_Of_Weightage table All the medicines first letter is in capital.
Now this gives me a problem when i am finding a string like this saying
adoRecWeight.Find "Rem_Abbr='" & Trim(charMed(0)) & "'", , adSearchForward, 1

Only those remedies whose cases are matching exactly are being updated means
aeth(in Ques_Table)=Aeth(Table_Of_Weightage) is not getting updated.
Is it possible because of case sensitivity
I can't even go to the main database table and change every first alphabet to capitals because that is a real long process.
Is there any string function which can help me to ignore the case while finding and updating in VB 6.0.
Please let me know...
Thanks

14-02-2006 at 08:09 PM
View Profile Send Email to User Show All Posts | Quote Reply
Dave Green
Level: Professor


Registered: 20-10-2005
Posts: 90
icon Re: String Function needed

Hi there
Simple method for this is to use UCASE or LCASE function on both your field value and the value you wish to compare against.

Something like:

If Ucase(MyTextField.value)=Ucase(MyCompareString) Then
   blah....blah

This will not change any value in the fields, simply converts the values within the (If) condition.

Hope this helps

Best regards
Dave



____________________________
While Breath.Count>0
       Live(gbRelax)
Wend

16-02-2006 at 07:28 PM
View Profile Send Email to User Show All Posts | Quote Reply
AndreaVB Forum : Database : String Function needed Solved Topic
Previous Topic (Too Many Tables)Next Topic (generate reports using VB.Net) New Topic New Poll Post Reply
Surf To:


Not Logged In? Username: Password: Lost your password?
Partners: Download Actual Software | Free Software Download
borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder