Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Case Sensitivity between VB program & Access Database

Status
Not open for further replies.

33216CLC

Programmer
Aug 17, 2000
173
BS
This program that I am working on in VB6 uses an access database. In the global module I defined a constant as "Salary" for a particular pay type. In a few instances where records were copied or imported into this database, Pay Type was "salary". The difference being the case of the first letter. When I attempted to execute a query in VB to search for records where pay type is "Salary", only the records with salary spelled with a capital "S" were selected.

How can I get over this problem without having to define another constant to handle "salary".


Thanks
 
Hi,
The easiest way is to put a where clause in the query with the condition being that "Show all records with type either 'salary' or 'Salary'.

Hope it works
 
Thanks. This is exactly what I did, and still some records with 'salary' were ignored. I had to go through each record from within my program (using a Next) to get all the records in a form that is acceptable to my program. Each time the next button is clicked the current record is saved using the settings in the program. I think that something other than the spelling of 'salary' could have contributed to the problem. Thanks.
 
You might have a space around the "salary" thingy. Try trimming the data.
 
Thanks Antzz. Tell me something. Do you know of a feature in Access that enables or disables case sensitivity?

 
Hi:
It sounds as if you are writing
IF typeName = "Salary" then
and yes if typeName is salary, there is no match.

You might try
If Trim(LCase(typeName)) = "salary" then
This should eliminate Upper case and space problems.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top