Ms acess database

G

gaffar

Sir,

I have created ms access database and tables with in that database at
runtime using vb.net code.
now i would like to establish relationship between the tables.
how to do this, please help me.

Thanks for your help.
 
N

Naresh Nichani MVP

Hi:

You could do this with CREATE TABLE/ALTER TABLE SQL like this sample from
Help

CREATE TABLE Orders (OrderId INTEGER PRIMARY KEY, CustId INTEGER, OrderNotes
NCHAR VARYING (255), CONSTRAINT FKOrdersCustId FOREIGN KEY (CustId)
REFERENCES Customers ON UPDATE CASCADE ON DELETE CASCADE

Regards,



Naresh Nichani

Microsoft Access MVP
 
M

MacDermott

I presume you've been using SQL statements like CREATE TABLE?
In that case, you'll need to use ALTER TABLE with a CONSTRAINT clause.
 
Top