Forum Discussion
MV77511
May 06, 2022Copper Contributor
Create Table statement not working in Access
CREATE TABLE Patient ( taxCode VARCHAR(16) NOT NULL PRIMARY KEY, name VARCHAR(32) NOT NULL, surname VARCHAR(64) NOT NULL, username VARCHAR(16) NOT NULL UNIQUE, password VARCHAR(16) NOT NULL, e...
arnel_gp
May 06, 2022Steel Contributor
that is MSSQL syntax?
use MS Access syntax.
https://docs.microsoft.com/en-us/office/client-developer/access/desktop-database-reference/create-table-statement-microsoft-access-sql
use MS Access syntax.
https://docs.microsoft.com/en-us/office/client-developer/access/desktop-database-reference/create-table-statement-microsoft-access-sql
- isladogsMay 06, 2022MVP
I believe that the ON UPDATE CASCADE and ON DELETE CASCADE statements are not supported by DAO in Access.
See https://msdn.microsoft.com/en-us/library/office/ff836971.aspx
You may be able to do this using ADOOr see alternative code at Microsoft Access tips: DAO Programming Code Examples (allenbrowne.com)
- MV77511May 07, 2022Copper ContributorYes, I found out you have to inject the query from the visualBasic editor and it works from there. Same with CHECK constraints. Thank you!