Book a Demo

Author Topic: How to change the db structure in EAP file  (Read 9700 times)

Stefan Bolleininger

  • EA User
  • **
  • Posts: 308
  • Karma: +0/-0
    • View Profile
How to change the db structure in EAP file
« on: May 31, 2013, 07:12:51 pm »
Hi,

for a few reasons i needed to change the db-structure. For example I need to extend the length of the Notes in t_document from VARCHAR255 to TEXT

While I could change it directly on the MySQL dbms-repository

Code: [Select]
ALTER TABLE `t_document` CHANGE COLUMN `Notes` `Notes` TEXT NULL DEFAULT NULL  ;
I haven't found a way to manage this in the EAP-file.


Are there any suggestions to make it also in eap-files. any idea, how I can open them? I suppose i do something wrong while i try to open the file using access.

Thank you

Best regards

Stefan

BTW: it doesn't work to change it within the DBMS and than transfer the dbms to the eap-file :-) The structure is NOT copied, only the content :-)
Enterprise Architect in "safetycritical development" like medical device industry. My free Add-in at my Website

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: How to change the db structure in EAP file
« Reply #1 on: May 31, 2013, 07:33:15 pm »
According to Mikeysoft's page http://msdn.microsoft.com/en-us/library/office/bb177883(v=office.12).aspx the command should be
Code: [Select]
ALTER TABLE t_document ALTER COLUMN [Notes] TEXT ;But even that throws a syntax error.

q.

Stefan Bolleininger

  • EA User
  • **
  • Posts: 308
  • Karma: +0/-0
    • View Profile
Re: How to change the db structure in EAP file
« Reply #2 on: June 01, 2013, 03:48:21 am »
I tried it as well. no chance.

Any other idea, how a filebased repository can be opened and edited?

Access 2010 doen't allow to open the file (it thinks it is outdated...)
Openoffice can open it but is not able to write...

Any ideas?
Enterprise Architect in "safetycritical development" like medical device industry. My free Add-in at my Website

philchudley

  • EA User
  • **
  • Posts: 750
  • Karma: +22/-0
  • EA Consultant / Trainer - Sparx Europe
    • View Profile
Re: How to change the db structure in EAP file
« Reply #3 on: June 01, 2013, 08:50:30 am »
Not an Access expert but isn't TEXT limited to 50 chars as stated below?

Microsoft Access provides two field data types to store data with text or combinations of text and numbers: Text and Memo.

Use a Text data type to store data such as names, addresses, and any numbers that do not require calculations, such as phone numbers, part numbers, or postal codes. A Text field can store up to 255 characters, but the default field size is 50 characters. The FieldSize property controls the maximum number of characters that can be entered in a Text field.

Use the Memo data type if you need to store more than 255 characters. A Memo field can store up to 65,536 characters. If you want to store formatted text or long documents, you should create an OLE Object field instead of a Memo field.

Both Text and Memo data types store only the characters entered in a field; space characters for unused positions in the field aren't stored.

You can sort or group on a Text field or a Memo field, but Access only uses the first 255 characters when you sort or group on a Memo field.


Anyway, does the update statement work as below

ALTER TABLE t_document ALTER COLUMN Notes MEMO;

i.e. No square brackets?

True opening an EAP file in Access 2010 (without converting) allows you to query but changes to design are disabled >:(

I guess if you could find an old version of Access that might work

Cheers

Phil
Models are great!
Correct models are even greater!

Stefan Bolleininger

  • EA User
  • **
  • Posts: 308
  • Karma: +0/-0
    • View Profile
Re: How to change the db structure in EAP file
« Reply #4 on: June 01, 2013, 05:05:13 pm »
Hi,

found it!

Phil: your Statement was right. Not that was only have the way.

At the end of this day i came to you with the full report about it - to share the knowledge.

Best regards ;D ;D ;D

Stefan

Enterprise Architect in "safetycritical development" like medical device industry. My free Add-in at my Website

Stefan Bolleininger

  • EA User
  • **
  • Posts: 308
  • Karma: +0/-0
    • View Profile
Re: How to change the db structure in EAP file
« Reply #5 on: June 02, 2013, 03:45:56 am »
OK, the promised results:

First: Deactivate "Jet 4.0 support" if enabled in "Tools-Options"
Second: Take the original File from your local-EA-location (The file is called EAExample.eap) and copy it somewhere to your disk.

Open the EAExample (It is a very fresh databae without any customer configuration, security or something.)

Create your own patchfile "patch.xml"
with something like that:

Code: [Select]
<?xml version="1.0" encoding="UTF-8"?>
<EAPatch>
      <EAPatch.content>
            <PatchDescription>Some patch.</PatchDescription>      
        <PatchSQL>
            ALTER TABLE t_document ALTER COLUMN Notes MEMO;
        </PatchSQL>
      
    </EAPatch.content>
</EAPatch>

Apply the patch into your open EAExample.eap-project by using "Tools-Data management-Run Patch"
answer all dialogs with "yes"
and wait for the Upcoming "Successful  ;) ;)"

Then you got your useable scheme for the database and can copy YOUR existing data-projects into it by using "Tools-data management-Project Transfer"

Best regards

Stefan
Enterprise Architect in "safetycritical development" like medical device industry. My free Add-in at my Website

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: How to change the db structure in EAP file
« Reply #6 on: June 03, 2013, 12:26:12 am »
Stefan,
I was not aware of this patch functionality. So thanks for the insight.

Sparx delivers also a Jet4.0 base model (it's somewhere on their pages and one of the supporters posted the link, but I can't remember the details). Probably it should be possible to apply the above to that base model too?

q.

Dermot

  • EA Administrator
  • EA User
  • *****
  • Posts: 591
  • Karma: +7/-0
    • View Profile
Re: How to change the db structure in EAP file
« Reply #7 on: June 03, 2013, 02:11:46 pm »