Skip to contents

Set foreign key constraint for a table field

Usage

hsSetForeignKey(
  mdb,
  tbl,
  field,
  ref.tbl,
  ref.field,
  key.name = .getForeignKeyName(tbl, field, ref.tbl, ref.field),
  dbg = FALSE
)

Arguments

mdb

full path to MS Access database file (*.mdb)

tbl

name of table containing the field for which the foreign key constraint is to be defined

field

name of table field for which the foreign key constraint is to be defined

ref.tbl

name of table containing the referenced foreign key field

ref.field

name of foreign key field in ref.tbl

key.name

optional. Name to be given to the foreign key

dbg

passed to hsSqlQuery