Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Remove relationship programatically

Status
Not open for further replies.

Charlix

Programmer
Nov 19, 2002
85
US
Hi,
I hope I'm posting this on the correct forum.

I get the following error message when I try to remove a one to many relationship in my database programatically:

*******
object required '[string: "C:\Caps1\CapsDb1.mdb"]'
*******

This is the code I am using on my asp page"

*******************
Set db = "caps1\capsDB1.mdb"

set rel = db.CreateRelation("321", "Multi Table", "Records Table")
rel.attributes = dbRelationDontEnforce
Set fld = rel.CreateField("MID")
fld.ForeignName = "MID"
rel.Fields.Append fld
db.Relations.Append rel

db.Relations.Update
*********************

What am I doing wrong?

Thanks,

Charlix
 
What am I doing wrong?
You are doing that:
set rel = "caps1\capsDB1.mdb".CreateRelation("321", "Multi Table", "Records Table")

You have to instantiate a Database object

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top