User Forum
Xequte User Forums
Profile    Active Topics    Forum FAQ    Search this forumSearch
Forum membership is Free!  Click Join to sign-up
Username:
Password:
Save Password
Forgot your Password?

     
Forum Tips
» This forum is for users to discuss their software problems and suggestions for improvement.  Remember that only a tiny percentage of our users experience such problems (To be precise less than 0.7% have ever posted on this forum)
» Include your software version number (as displayed in the About Box)
» Check the FAQ before posting as most common questions have already been answered
» You don't need to also e-mail us separately as our support team will respond to all questions on this forum
 
 All Forums
 Xequte User Forums
 MailList King
 Queries in Access
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

bell1jl

USA
12 Posts

Posted - Mar 03 2009 :  18:25:11  Show Profile  Reply
I'm trying to query the MLK database from Access 2003. I have the ODBC driver installed and I can pull up all the records in the MLK database just fine. I want to create a query that will allow me to type in a last name and return the record in Access.

I have successfully created a query that prompts me to input an integer for the number of groups joined -- the query returns all the users who have a GroupMembership equal to that number. The query looks like so:

SELECT *
FROM mlk_main
WHERE (((mlk_main.GroupMembership)=[Number of Groups]));


However, when I do the same thing and replace "mlk_main.GroupMembership" mlk_main.LastName and prompt for the last name, it returns nothing. Does the ODBC driver need some special to query against strings? It seems like it should just work but I've been banging my head against a wall trying to query this DB.

Also, I am unable to write to the database, I get a record lock warning. I'm on Vista using Access 2003 and the latest (I think) ODBC driver that I downloaded only days ago.

I really need some help with this.

Thanks

xequte

7504 Posts

Posted - Mar 03 2009 :  22:17:27  Show Profile  Reply
Is casing an issue? Are you using UPPER()?

How about if you do a hard coded query:

SELECT * FROM mlk_main
WHERE (UPPER(mlk_main.LastName)="SMITH")



Nigel
Xequte Software
www.xequte.com
nigel@xequte.com
Go to Top of Page

bell1jl

USA
12 Posts

Posted - Mar 04 2009 :  10:48:11  Show Profile  Reply
Hard coded queries work, just not when I try to use a parameter. However, I AM able to use a parameter if I'm querying an integer like the user ID field or something. So, I know I can pass parameters, there just seems to be something wrong when I go to use a parameter to query a string.
Go to Top of Page

bell1jl

USA
12 Posts

Posted - Mar 04 2009 :  16:29:37  Show Profile  Reply
I wanted to let you know that I did get it work based on your feedback above! In Access, "UPPER" isn't a recognized command but UCASE is. I ended up using this syntax:

SELECT*
FROM mlk_main
WHERE ucase(mlk_main.LastName)=[Last Name]

I've played around with it and for whatever reason, I need to include the UCASE conversion in the query for it to return anything. Odder still, I can pass in the last name in all lowercase, uppercase, or mixed case and it still returns the results -- very bizzare but it works.

Thank you!
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To: