Can't define new name to relationship...

Hi,

Can't I redefine relationship name in CDM model by script?

I'm try this code but it return a error... :-(

Option Explicit

Dim mdl
Set mdl = ActiveModel

If (mdl Is Nothing) Then
   MsgBox "Has no model active..."
ElseIf mdl.IsKindOf(PdCDM.cls_Model) Then
   ProcessCDMFolder mdl
End If

Private sub ProcessCDMFolder(folder)
   Dim rel
   for each rel in folder.Relationships
      if not rel.isShortcut then
         Dim ent1, ent2
         Set ent1 = rel.Entity1
         Set ent2 = rel.Entity2
         'rel. = rel.Name
         rel.Name = ent1.Code + "_" +  ent2.Code
         rel.Code = rel.Name
      end if
   next
end sub

0
augustomendonca
2/7/2003 8:02:53 PM
sybase.powerdesigner.general 9408 articles. 1 followers. Follow

4 Replies
522 Views

Similar Articles

[PageSpeed] 56
Get it on Google Play
Get it on Apple App Store

Hi,

Your script works fine on my PC.  I suspect your model naming options for 
relationship are set so that some character in the name (the underscore?) 
is invalid.

And if you have 2 relationships between the same 2 entities you will need 
to address duplicate names.

Rick Bell
0
Rick
2/7/2003 11:02:05 PM
Hi Rick,

the error message is below:

Error: That name already exist! (0c80020009)
At line 34, character 10

0
augustomendonca
2/10/2003 6:31:19 PM
The script is probably encountering 2 entities with more than 1 
relationship between them, and trying to apply the same name and/or code to 
both of them.

Before you set the name of a relationship you need to check if it is a 
duplicate of an exiting relationship name or code.  The check would look 
something like this:

if relationship.cansetattribute("name",NewName,"")
else NewName = NewName & ":2". 


Rick


Re: Can't define new name to relationship...

Hi Rick, 
the error message is below:

Error: That name already exist! (0c80020009)
At line 34, character 10
0
Rick
2/10/2003 11:32:25 PM
Hi again!

Your comment is correct!

"...And if you have 2 relationships between the same 2 entities you will 
need to address duplicate names."

I did use the code below and that's all right!

if not ref.isShortcut then
   Dim tab1, tab2, j, fkcol
   Set tab1 = ref.ParentTable
   Set tab2 = ref.ChildTable
   for each j in ref.Joins
      set fkcol = j.ChildTableColumn
   next
   ref.ForeignKeyConstraintName = tab1.Code + "_" +  fkcol.Code
   ref.Code = tab1.Code + "_" +  tab2.Code + "_" + fkcol.Code
   ref.Name = tab1.Code + "_" +  tab2.Code + "_" + fkcol.Code
end if

Thanks very much!
0
augustomendonca
2/17/2003 7:37:17 PM
Reply:

Similar Artilces:

I can't get no cache, I can't get no cache. 'Cause I try and I try and I try and, I can't get no, I can't get no cache.
I have fiddled out for days tinkering with the setting in about:config trying to get FireFox 12 to use the disk cache. I have NOT found the trick. This One Trick Pony ain't doing it like it used to up until recently. Pray tell anyone, What information can I share that will point a knowledgeable person to aid me in getting FF to disk.cache? I have also tried restarting FF with add-ons disabled, (There were NOT too many to do this to, so it was quick and easy) Here is my stab at trying to convey the information that MIGHT govern matters Using about:cache Informatio...

Re: I can't get no cache, I can't get no cache. ' Cause I try and I try and I try and, I can't get no, I can't get no cache.
<div>please com e see me about htis<br /> <br /> ------- Original Message f= rom the Global Relay Archive -------<br /> From: Hp &lt;ferd@farkel.net&gt;= <br /> To: "support-firefox@lists.mozilla.org" &lt;support-firefox@lists.mo= zilla.org&gt;<br /> Sent: Sun, 27 May 2012 18:30:18 -0700<br /> Subject: I = can't get no cache, I can't get no cache. 'Cause I try and I try and I try = and, I can't get no, I can't get no cache.<br /> <br /></div> <pre class=3D"gr-maex-body-pre&qu...

2010: Can't register - can't download the software - can't register until I have the software
I have active maintenance on Rad Studio: From: Vicky Rassmisaengthong [mailto:Vicky.Rassmisaengthong@EMBARCADERO.COM] Sent: Wednesday, February 25, 2009 1:58 PM To: rgrossman Cc: amer.supportadmin@codegear.com; Ashley Cosentino Subject: Software Assurance Support for Tech III Inc PO# Credit Card Dear Embarcadero Technologies Support Customer, Welcome! You have been registered as the primary contact on support account number AM####### Herewith we confirm your Embarcadero Technologies support agreement covering: Qty 1 RAD Studio Enterprise Named User licens...

Add New Project problem: Can't edit name/location for new ASP.NET apps
 Is there a setting in .NET that defaults the location of new ASP.NET projects and solutions? When I create a new ASP.NET web app or try to add a new ASP.NET app to an existing solution, the location field in on the Add New Project window defaults to folder I deleted about a month ago.  Also, if I try to change the defaulted location, the OK button blurs and I cannot select OK to create the project in the new directory I browsed to. If I accept the default location for the new project, I cannot update the name to something meaningful, I am stuck with WebApplication1. Any...

Two things,Why do I keep getting emails that I don't want. can't get rid of them? Why can't I get my email when I am out of town? Or can I?
Name: Ed Leech Email: ELCraftatzoominternetdotnet Product: Thunderbird Summary: Two things,Why do I keep getting emails that I don't want. can't get rid of them? Why can't I get my email when I am out of town? Or can I? Comments: I am getting frusted with all the emails coming in that I do not want, I am using the tools to get thme out but they keep coming. They just use different names or whatever. I have been thinking of just switching to something else but my business intrusts know this email and it is tooo confusing to change. Every time I go out of town on bu...

Can't base report on stored procedure--'Can't create Datawindow'
I installed IM65 today to give it a try. I made a db config to our local ASE 11.9.2 engine via Sybase' odbc driver that came with 11.9.2. I start a new report, tell it to be tabular and to get data from a SP. It asks which SP and I tell it. The result is an odbc error: Cannot create DataWindow Intersolv SQL ODBC driver: Incorrect syntax near '='. 1 execute dbo.sp_si_addressbest_;0 RETURN_VALUE = :RETURN_VALUE' I can execute the SP fine from SQL Advantage or from Crytal Reports. Thanks. -- Frank Burleigh Indiana University School of Law Bloomi...

I can't stop a 'what's new' tab opening
Name: Bradley Crees Product: Shiretoko Summary: I can't stop a 'what's new' tab opening Comments: every time I open firefox it opens a tab with http://en-us.www.mozilla.com/en-US/firefox/3.1b1/whatsnew/ I can't stop it coming up, and it's affecting my ocd Browser Details: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.1b1) Gecko/20081007 Firefox/3.1b1 From URL: http://hendrix.mozilla.org/ Note to readers: Hendrix gives no expectation of a response to this feedback but if you wish to provide one you must BCC (not CC) the sender for them to ...

can't get reports 'Old Chart's and 'New Charts' to work properly
1. If I try and draw a chart it doesn't go beyond June of this year so I'm missing a lot of data in the output. 2. Is there a reason for this - I have been modding bugzilla so that it has an extra status field from earlier this year - would that have had an impact ? 3. Also when I try and do a Old Chart or NewChart I can't see my new 'Status' field to select - this is ok if I do a bar chart though. cheers On Mon, 2011-12-05 at 03:25 -0800, nothtb@ukonline.co.uk wrote: > 1. If I try and draw a chart it doesn't go beyond June of this year so &g...

new server name can't be resolved
Hello, I have installed a new NW6 sp3 server into an existing tree. Everything went through fine but I seem to have a problem with name resolving. From the new server I can ping all other server names in the tree aswell as the new server. From all other servers I can ping all other server names except the new server. When I try to ping the new server I get the error message "Could not understand ``nwabc01'' as a host name or address. Please make sure NETDB.NLM is loaded and SYS:\ETC\RESOLV.CFG is configured correctly". I have been through the IP and DNS...

Can't find any 'Create new database'
Hi, I'm a newbie in PB I've just bought a book 'Developing Power Builder 5 App.' I click on applicaiton painter, then the example will show up however, when i want to create new database i can;t find that menu on the file menubar Instead there's only configure ODBC anyone can help? If i can't create new database then i can;t go on to next page for my book :) Thanks Teguh Luntoro Actually, the best way to create a new SQLAnywhere database is to use the Sybase Central utility, or just use the dbwrite program (typically located in c:\sqlany50\win32)...

Can't open Can't delete
Name: Mike Gordon Email: mikeatmgendodotcodotnz Product: Thunderbird Summary: Can't open Can't delete Comments: HELP I cannot open thunderbird after latest update. It has an error message thunderbird.exe is not a Win 32 command. I also cannot delet it to reload it I need some help Please Browser Details: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 1.1.4322) ...

They Can't Crack What They Can't Find
They Can't Crack What They Can't Find noeld@rootprompt.org The Internet today is a jungle full of predators. Some of these predators are trying to crack your machine others are just looking for a machine to crack. By using the firewalling tools built into the Linux kernel it is possible to make a desktop machine virtually disappear from the crackers view. In this article I will describe how to hide a machine running Linux that uses PPP over a modem to connect to the Internet. I will use ipchains and the firewalling built into the Linux kernel to protect the services that are ...

Can't boot, can't update
I have upgraded from SuSE version 11.3 (which worked well) using zypper dup. Unfortunately, an earlier post regarding resolution of a CPU crash during boot turned out to be premature, as it is now intermittent. When booting, the system: (1) UDV reports a CPU crash (on-screen dump) (2) if the computer is reset (turned off, then on again), it will eventually either boot up normally (rare) or display a screen with a very wrong resolution setting. Repeatedly rebooting will eventually tease the system into normal operation, but it usually takes several attempts. Several Grub parame...

can't connect and can't scroll
Name: Product: Firefox Summary: can't connect and can't scroll Comments: Downloaded beta 6 several times and I can never get online. Everything else connected to the internet works fine, but I can't open a single page in firefox. Also, I'm currently using beta 4 so I don't know if this has been improved, but every time I minimize firefox and later maximize it, I can no longer use the mousepad on my laptop to scroll without reloading the page. Vista Home Premium 32-bit Dell XPS M1330 Intel T9300 Browser Details: Mozilla/5.0 (Windows NT 6.0; rv:2.0b4) G...

Web resources about - Can't define new name to relationship... - sybase.powerdesigner.general

Relationship between Friedrich Nietzsche and Max Stirner - Wikipedia, the free encyclopedia
By the turn of the century the belief that Nietzsche had been influenced by Stirner was so widespread that it became something of a commonplace, ...

Entity-relationship model - Wikipedia, the free encyclopedia
In software engineering , an entity-relationship model ( ER model for short) is an abstract and conceptual representation of data . Entity-relationship ...

Australia-Indonesia relationship in 'very good shape': Julie Bishop
Australia and Indonesia have declared their relationship back on track amid improved co-operation on counter-terrorism and shared concerns about ...

How Has Digital Technology Changed Your Relationships?
... on the phone while in the bathroom? It's not uncommon; in fact it's the new normal. But how has this constant connection changed our relationships ...

The relationship between UPS and Amazon, its biggest client, is fraying
The relationship between Amazon and the United Parcel Service is fraying, The Wall Street Journal reports . The Amazon account at UPS is, according ...

Big Bang: Sheldon and Amy consummate relationship
"Amy's been eager all along for a different kind of connection, but it's actually initiated by Sheldon," "Big Bang Theory" star Mayim Bialik ...

That Kylo Ren Rumor About His Relationship To Rey? Here's The Truth
Reports going around about a video that reveals the true nature of the relationship between Rey and Kylo Ren in the new Star Wars movies may ...

All Gwen Stefani Needed WAs One Video To Prove Her Relationship With Blake Shelton Is Real
All Gwen Stefani Needed WAs One Video To Prove Her Relationship With Blake Shelton Is Real

Chris Brown Talks Tough Relationship With Parents, Fame, Wanting To Rap: 'I'm No Role Model'
Chris Brown spoke about fame, his troubled past and creative freedom in a new interview.

India And Japan: In Search Of A Relationship
Indian PM Modi and Japanese PM Abe The wording of the sub-title, “in search of a relationship”, is deliberate. It would be incorrect to write ...

Resources last updated: 12/27/2015 5:50:47 AM