Access Select specific tables to update, change and modify - forms

I create a DB where each table is a different project.
However, i am not sure how i would go about creating a form in which a user can choose a specific table (project) from a drop down menu and than be able to update/edit/modify the contents in the table.
Each table is standardized to contain exact column headers.
Thanks in advance for you help.

Related

How do I generate a list of views dependent on a certain table in postgresql?

I need to update a mapping table in postgresql, but of course it won't allow me to replace/drop the original table as there are dependencies.
The error message details does list the dependent views, but I'd like to generate a list programmatically so that I can make temp views while I drop my original mapping table and migrate the views back afterwards.
Prefer not to do this in SQL Shell incidentally. Any pointers would be much appreciated.

How do you change a table's schema?

We have a MySQL Workbench project with two tabs (two schemas/two databases).
If we create a table in the first tab, it's attached to the schema
magikweb_dev_igcweb.
If we create a table in the second tab, it's attached to the schema
magikweb_dev_igcweb_archive.
If we copy-paste/duplicate a table from the first tab to the second tab, the resulting table remains in the first schema. How can you change a table's schema?
Each schema is linked with a specific database, so when we use the "Synchronize Model..." feature, it links all the tables properly.
Use the model tab. You can cut out a table from one schema tab and insert it into another.
The cut-and-paste method described in another answer works well for tables with no foreign keys, and for a reasonable number of tables.
An alternative that preserves foreign keys is to export the model as a SQL script, edit it, and then import the new script into a new model.
Using MySQL Workbench v6.3:
File -> Export -> Forward Engineer SQL Script
Carefully edit SQL script. Replace references to one schema with the other, for the tables you want to move. Do this both for CREATE TABLE commands and foreign key references.
File -> New Model
File -> Import -> Reverse Engineer SQL Script
Unfortunately you will then need to recreate any diagrams. But that can be straightforward if you have the original diagram as reference (take a screenshot or export it to PNG or PDF.)
Follow this simple steps (never miss step 4 and 5) :
Open Model Tab
Choose source schema. In my case, I want to copy table users from schema abc_develop_v1 to schema abc_develop_v2 then paste to diagram . So I choose schema abc_develop_v1, right-click table users then Copy 'users'
Go to the targeted schema. In my case is schema abc_develop_v2, right-click then Paste 'users'
Next, copy table users from schema abc_develop_v2. Right-click table users then Copy 'users'
Go to your diagram and Paste 'users'.
That's all. Your table is ready in your diagram with the right schema :-)
Notes: You can double check by double-click on the table in your diagram, and look at the right corner. It will show the Schema name.
I found a less painful way to do this.
Save and backup your diagram and your schema.
Display schema's name before table's names in diagram. This will make the next step easier.
Right-click on the tables which are on the wrong schema, and select "Copy SQL to clipboard". Paste the script in a new SQL window. Repeat for each table you want to migrate.
Edit the script to change the schema name. Watch for any miss in entries, the wrong schema might be a reference at any line. Mine was mydb, which I don't remember creating. Execute the script. Now you have the tables on the right schema.
Synchronize your model. Be sure to check "Update the model" for each missing table, otherwise, the tables will be deleted from the schema :)
Drag'n'drop the newly created tables into the diagram. Then remove the ones which are using the wrong schema. Tip: tables that are not in diagram won't display a dot next to their name.
Optionally, you can delete the faulty schema from the model so this never happens again. Be sure to know what you're doing first!

Some fields are missing in the fieldexplorer. How to show all fields?

i'm using Crystal Reports with my ERP-System. There have been predefined reports i now want to change.
In the field-explorer are some tables which have been renamed for better readability. But those tables are missing some fields, i want to use. If i connect the whole table again, all fields are there. Is there a way to display all fields in the predefined tables.
I tried to refresh the Database but nothing changes. If i delete the predefined table and then rename the new one to the old one, so i can use all predefinded formulas, all used fields in the report get deleted. I would need to recreate the whole report then.
Thanks for the help
If it is truly the same table and is not showing all the fields then you need to do "Database > Verify Database". That will force CR to refresh the structure of the table (instead of just the data). If this doesn't add the missing fields then the table in the report is actually a different object.
To see what the table/view the report is actually using go to "Database > Set DataSource Location" and look at the properties node for that table. It will show if it is a table/view/SP and what the true object name is.
If you want to replace the existing table with a different table you go to "Database > Set DataSource Location" again. Highlight the existing table in the top window, connect and highlight the replacement table in the bottom window. Then click update. Crystal will replace one table with the other and all of the fields in the report that exist in the new table will be mapped automatically. Note that the new table will keep the alias of the original table. If you are unsure if the table was updated you can look at the properties node in the top window to see the change.

Is it possible to create table templates in Filemaker?

I'm using Filemaker Pro 12 and I was wondering if there is a way of creating a template for tables. There are a number of fields I'm placing in my tables that are identical utility-fields like modification time-stamp, active/inactive flags, etc. I was hoping there was a way that I could define the skeleton of each table somehow instead of having to manually add these identical fields every time.
If you are using the Advanced version, you can copy&paste fields among tables/files.
Using the regular version, you can import records from your "default" table and specify [New Table...] as the target table. This will recreate the source table's structure in the target file. The source table does not have to contain any records for this to work.
To expand a little bit on michael-hor257k's answer, if you're using FileMaker Pro Advanced, a good practice is to create a "Default" table that has your core utility fields. When you want to make a new table in Manage Database, instead:
Highlight the Default table,
Copy & Paste the table, then
Rename the new table.

Crystal: Autoupdating table names in database expert

It is more of an annoyance rather than real issue: when in Crystal reports you change the data source to one with different name (and do all the linking old columns to new columns) all the table names in Field explorer and (obviously) in formulas are changed. But the Database expert still shows the old table/view name!
Let me show this on example: Lets say I change TABLE_1 with column EQUIPMENT to VIEW_1 with column UNIT. Via the datasource location I can do the substitution and link old column EQUIPMENT to new one - UNIT.
But when I check either Datasource location or database expert it will be still showing old TABLE_1 (if you check the columns in the link tab you will notice that the TABLE_1 has now column UNIT instead of EQUIPMENT).
This can be quite annoying and frankly bit dangerous, especially if you return to report after a longer while. Is there somewhere a setting that allows to autoupdate table names in the database expert?
When you create the report it will create tables and each table will be linked to a datasource table. So the report table will have a name and datasource , which might be the same. When you change the datasource the datasource of the table will be updated but the report table name will remain the same. Think about this name as an alias. It might differs from th datasource name if you use the same table multiple times
I don't think there is auto update option in crystal reports but one thing you can do is to use Verify Database option under Database tab whenever you update the tables.
You need to manually edit table names in Database expert, there's no automatic way (and like Lan already answered, it is generally not possible).