Computer Learning Zone CLZ Access Excel Word Windows

Why are we here? Because we're here. Roll the bones.

-Rush
 
Home   Courses   TechHelp   Forums   Help   Contact   Merch   Join   Order   Logon  
 
Back to Access SQL Seminar Part 3    Comments List
Upload Images   @Reply   Bookmark    Link   Email   Next Unseen 
Constraint Check Not Working
Joe Hood 
      
5 years ago
Going through Lesson 8 Cannot get the following statement to work to add a validation rule to CreditLimit field.

CREATE TABLE CustomerT
(
CustomerID COUNTER,
FistName TEXT (20),
LastName TEXT (20),
CreditLimit CURRENCY,
CHECK (CreditLimit>1000)
);

Getting Run-time error 3292
        Syntax error in field definition

Will not work using the following either;

ALTER TABLE CustomerT
ADD CONSTRAINT chkCredit CHECK (CreditLimit>1500)

Run-time error 3289
Syntax error in CONSTRAINT clause.

Any ideas on what is wrong?

Thanks,
Joe
Richard Rost  @Reply  
          
5 years ago
Yeah, that should work. I just tried it myself and it doesn't want to work for me either. I'm wondering if there's either a bug in the new versions of Access that nobody has caught yet (doubtful) or Microsoft changed it somehow. Let me do a little research. A quick Google search shows nothing. Unfortunately, this is one of those things I almost never use personally. If I'm going to create a table, I'll use a Recordset. :)
Richard Rost  @Reply  
          
5 years ago
OK. I think I found the reason. Hang on while I test it. I like to be sure before I explain.
Richard Rost  @Reply  
          
5 years ago
Alright... it's been 10 years since I recorded this seminar (wow) so I forgot about this. I don't use SQL to create tables on a daily basis (like I said, I use Recordsets, which I'm going to teach in an upcoming lesson very soon). However, in order for this to work from lesson 8, you have to have first watched lesson 7. In lesson 7, I explain that you have to switch your database to follow ANSI 92 rules (basically SQL Server syntax). If you don't, Access by itself doesn't support the CONSTRAINT - CHECK syntax you're using. Watch lesson 7. But thanks for asking me this... it was a good refresher. First thing to start off my morning was re-remembering something about Access that I knew 10 years ago but have since forgotten because I don't use it all the time. LOL
Joe Hood OP  @Reply  
      
5 years ago
LOL! Watched Lesson 7 while multitasking. Not a good idea. Switched to 92 and all is good. Thanks Again.

This thread is now CLOSED. If you wish to comment, start a NEW discussion in Access SQL Seminar Part 3.
 

Next Unseen

 
New Feature: Comment Live View
 
 

The following is a paid advertisement
Computer Learning Zone is not responsible for any content shown or offers made by these ads.
 

Learn
 
Access - index
Excel - index
Word - index
Windows - index
PowerPoint - index
Photoshop - index
Visual Basic - index
ASP - index
Seminars
More...
Customers
 
Login
My Account
My Courses
Lost Password
Memberships
Student Databases
Change Email
Info
 
Latest News
New Releases
User Forums
Topic Glossary
Tips & Tricks
Search The Site
Code Vault
Collapse Menus
Help
 
Customer Support
Web Site Tour
FAQs
TechHelp
Consulting Services
About
 
Background
Testimonials
Jobs
Affiliate Program
Richard Rost
Free Lessons
Mailing List
PCResale.NET
Order
 
Video Tutorials
Handbooks
Memberships
Learning Connection
Idiot's Guide to Excel
Volume Discounts
Payment Info
Shipping
Terms of Sale
Contact
 
Contact Info
Support Policy
Mailing Address
Phone Number
Fax Number
Course Survey
Email Richard
[email protected]
Blog RSS Feed    YouTube Channel

LinkedIn
Copyright 2026 by Computer Learning Zone, Amicron, and Richard Rost. All Rights Reserved. Current Time: 5/6/2026 1:55:45 AM. PLT: 1s