Please Help - Syntax error in - ON UPDATE

D

Dhananjay

Hi all!

I am using vb6 & access 2003.
I am adding one constraint on existing table's column like -
"ALTER TABLE XYZ ADD CONSTRAINT FK_XYZ_ABC FOREIGN KEY (XId) REFERENCES
ABC(XID) ON UPDATE CASCADE ON DELETE CASCADE"

But I am getting the error "SYNTAX ERROR" at ON UPDATE.
I m using the connection object . My code snippet is below-

'********************************************
dim con as adodb.connection
con.ConnectionString = "DSN=" & Trim(DSN) & ";uid=" & Trim(User) &
";pwd=" & Trim(pwd)
con.open
sAccess="ALTER TABLE XYZ ADD CONSTRAINT FK_XYZ_ABC FOREIGN KEY (XId)
REFERENCES ABC(XID) ON UPDATE CASCADE ON DELETE CASCADE"

con.execute sAccess
'********************************************
Any help would be greatly appriciable!!
Thanks in advance.
Dhananjay
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top