Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
steelkilt
Constraint Violating Yak Guru
255 Posts |
Posted - 2002-09-23 : 14:40:58
|
| Anyone know if it's possible to launch popup messages in Access when a user attempts to update a row/add a row to a table that is linked directly to a SQL Server 7.0 table?My data validation rules have been written on the SQL Server 7.0 side and I would love to alert Access users immediately when they violate a rule in a specific field rather than have them fill out a whole row in Access only to be presented at the end of the update with a vague ODBC error that wipes out all their work.Background: these Access link tables are temporary data entry modules until I create the web interface.Thanks. |
|
|
robvolk
Most Valuable Yak
15732 Posts |
Posted - 2002-09-23 : 15:06:56
|
| SQL Server won't enforce the rules until the entire row is updated/inserted. If any of the checks fail you'll get an error message, but if the user violates 2 or more rules you may not get all of the errors returned.The only way for you to perform checks column-by-column is to write VB code behind the MS Access form that checks each one on their OnUpdate or OnChange event. This would NOT work in datasheet view though, only form view. Basically, you're duplicating the logic in Access, and you'd need to edit both SQL Server and Access should anything change. If you're moving this to a web interface you'll have to pretty much do this anyway (client-side validation) so doing it in Access will be good practice.You can also add an OnError handler for the form, it will catch the ODBC errors, and you can individually restore those values that are acceptable to the database, but it will probably be more work as any other method.Edited by - robvolk on 09/23/2002 15:07:49 |
 |
|
|
|
|
|