PC Review


Reply
Thread Tools Rate Thread

CreateRelation to Other Tables file, throws 3409 error

 
 
brandonjelinek
Guest
Posts: n/a
 
      16th Sep 2008
The following code throws a 3409 Error when i run it from my Development
database. When i run the code with set dbs = currentdb and run it within the
Tables_Main database.. it works.. but when i try to open a workspace and open
it remotely and add the relationship. It fails to work. Is there some trick
to adding a relationship to a remote access 2007 table?

Function NewRelation()
Dim dbs As Database, rel As Relation, fld As Field, wrkplace As Workspace

Set wrkplace = DBEngine.Workspaces(0)
Set dbs = wrkplace.OpenDatabase("Tables_Main.accdb")
Set rel = dbs.CreateRelation ("Main_People_Famlies", "Main_Families",
"Main_People")
rel.Attributes = dbRelationUpdateCascade And dbRelationDeleteCascade
Set fld = rel.CreateField("ID_Main_Famlies")
fld.ForeignName = "ID_Main_Famlies"
rel.Fields.Append fld
dbs.Relations.Append rel
dbs.Relations.Refresh
Set dbs = Nothing
End Function

sorry i accidentally posted this in general twice... might tell you
something about me

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
CreateRelation to Other Tables file, throws 3409 error brandonjelinek Microsoft Access 4 19th Sep 2008 01:48 AM
CreateRelation to Other Tables file, throws 3409 error brandonjelinek Microsoft Access 0 16th Sep 2008 09:14 PM
Re: Error code 3409 Douglas J. Steele Microsoft Access Getting Started 0 25th Aug 2008 11:49 PM
IE throws error message when downloading a file from ASP.NET web p =?Utf-8?B?T2xpdml1Rw==?= Microsoft ASP .NET 2 5th Jul 2006 05:48 PM
Error on mscorlib throws file exists exception =?Utf-8?B?RXJyb3Igb24gbXNjb3JsaWIgdGhyb3dzIGZpbGUg Microsoft Dot NET Framework 1 1st Mar 2006 08:53 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:46 AM.