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

SQL Statement problem 1

Status
Not open for further replies.

mtek13

Programmer
Aug 23, 2001
24
CA
HI,

I am developping a billing program and now i am creating a secuty form in which the administrator of the sytem will be using to enter new users or edit existing users.
The problem i am encoutering now is that my SQL statement
doesnt work. And i dont know why.

The code is the following

strSql = "SELECT * FROM [USERS] " & _
"WHERE ([USERNAME] Like '" & strUsername & "*')"& _
" ORDER BY [Username] DESC;"

rs.Open strSql, cn, adOpenKeyset

I am not getting any error, the problem is that the recordset is empty, and i have in my table about 50 users that i am testing on.
If someone has a clue why this code does not work please reply.

Thanx.
 
Try changing your wildcard character from '*' to '%'.

Like '" & strUsername & "%')"& Thanks and Good Luck!

zemp
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top