Constraint Syntax Error (1 Viewer)

JaedenRuiner

Registered User.
Local time
Today, 05:57
Joined
Jun 22, 2005
Messages
154
I'm running a simple update to my application, where on boot it tests to see if the back end database is up to date. if it isn't, i add a new table and a few columns to other tables so it is the most recent version of the database.

I am simply performing an "OpenDatabase" on the file, and then using teh Database object to execute some sql. The Create Table works fine. The Alter Table Add Column works fine, but the Alter Table Add Constraint says "Syntax Error in Constraint Clause". Where's the error, this is identical to what's in the help documentation.

sql = "ALTER TABLE tbl_ServiceInvoices " & _
" ADD CONSTRAINT FKProviders FOREIGN KEY (ProviderCode) " & _
" REFERENCES lst_Providers (ID) " & _
" ON UPDATE CASCADE ON DELETE SET NULL;"

Thanks
Jaeden "Sifo Dyas" al'Raec Ruiner
 

Users who are viewing this thread

Top Bottom