I'm using Access from a Java program via ODBC. I'd rather not use VB or any other non-protable stuff in order to keep my database-options open in the future.
carstensm> You say that you already make a select before your insert, what is wrong with doing it that way? If you dont do it there then you would have to do it in a stored procedure anyway, how else will you know if it is valid?
I was hoping that "Validation Rule" would be able to accept queries or the like. Another posibility was that Access supported advanced sql(can't remember what it's called) with IF...ELSE, as I believe MS-SQL does.
But maybe I set my hopes too high, so I'll just carry on as I used to.
IF ...ELSE is not supported in an Access (jet) database, although it more than likley is if you use the MSDE database (Access 2000 and later) The MSDE database is actually a "cut down" version of SQL Server so it supports stored procedures and triggers. I have NEVER used this database although I have used SQL SERVER which supports much more than Access. I still do NOT see how you can get away with having to make a select on the table containing the dates.
The problem with using the validation rule is that the record is not yet written to the database so you cant refer to the field containing the date from the validation rule property.
I think your current method is fine :o)
Synes godt om
Ny brugerNybegynder
Din løsning...
Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.