Strange tendency in MS Access?

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
erupt
Forum Commoner
Posts: 58
Joined: Sat Feb 25, 2006 10:24 am

Strange tendency in MS Access?

Post by erupt »

I'm sure many people know that this happens .... but does anyone know why you're not allowed to have a column named "password" in any tables? You're allowed to create it in Access, but it always creates errors when using ADO.net to insert records, update etc.

Anyone know why that happens?
User avatar
hawleyjr
BeerMod
Posts: 2170
Joined: Tue Jan 13, 2004 4:58 pm
Location: Jax FL & Spokane WA USA

Post by hawleyjr »

Password is a reserved word.

Can you add a hash around the field name?

`password`
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Re: Strange tendency in MS Access?

Post by RobertGonzalez »

erupt wrote:I'm sure many people know that this happens .... but does anyone know why you're not allowed to have a column named "password" in any tables? You're allowed to create it in Access, but it always creates errors when using ADO.net to insert records, update etc.

Anyone know why that happens?
Like hawley said, Password is reserved. Many database applications and management systems reserve words for the system that cannot be used as field names. MySQL has a table of reserved words on their website, so I would imagine that MSDN would have something similar.

Hawley, does Access accept backticks in queries? I thought Access uses brackets for field names ([tablename].[fieldname]). Just a thought, if backticks don't work try brackets.
User avatar
hawleyjr
BeerMod
Posts: 2170
Joined: Tue Jan 13, 2004 4:58 pm
Location: Jax FL & Spokane WA USA

Re: Strange tendency in MS Access?

Post by hawleyjr »

Everah wrote: Hawley, does Access accept backticks in queries? I thought Access uses brackets for field names ([tablename].[fieldname]). Just a thought, if backticks don't work try brackets.
Ha Ha, I have no idea that's why I said `try` (No pun intended on the hash markes used in try) :)

It's prob. been 6 years since I've even opened up Access :) :) :)
erupt
Forum Commoner
Posts: 58
Joined: Sat Feb 25, 2006 10:24 am

Post by erupt »

I just tried creating a field with backticks. Access said absolutely not :)
User avatar
s.dot
Tranquility In Moderation
Posts: 5001
Joined: Sun Feb 06, 2005 7:18 pm
Location: Indiana

Post by s.dot »

Don't create the field with backticks.
Use it in your query.
Although, like everah said, msaccess uses brackets.. so try that.
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
Post Reply