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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ADODC recordsource: changing the case of my strings!?

Status
Not open for further replies.

Edd

Programmer
Jun 22, 2000
10
0
0
US
I'm using the ADO data control. I build a string for my SELECT statement to look up a user name, such as:

Code:
pc_select="SELECT * FROM user WHERE username='" & UCASE(username) & "'"

I then assign pc_select to .recordsource:
Code:
pc_select=.recordsource

When running the program with a breakpoint in that area, my "immediate window" shows my pc_select correctly displaying the string, for example:

Code:
"SELECT * FROM user WHERE username='MIKE'

But... after assigning pc_select to the .recordsource,
.recordsource shows:
Code:
"SELECT * FROM user WHERE username='mike'

Of course, my query never finds "mike" since it is in lower case.

Why the change of case, and how can I fix that?
 
Did you mean .recordsource = pc_select?
Can you post more complete code?
 
try this before the select statement:

username = ucase(username)

Then do this as the query:

pc_select="SELECT * FROM user WHERE username='" & username & "'"

Let me know if that works. ;) Take Care,
Mike
 
:)I Yeah - I did mean:
Code:
.RecordSource = pc_select[\code]

I will try using Ucase to make sure the field entry gets capitalized, but it still doesn't make sense to me why the string in pc_select didn't match what was in .RecordSource.

Thanks for the tips!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top