Hello,
I come to you for a big doubt that I have. I am seeing a subject that has to do with distributed databases, and we are instructed to carry out a small exercise, with an Access database... We are instructed to create a database, divide it and apply the concept of fragmentation.
I made 2 virtual machines in VMWare, I divided the database between those two machines already:
The changes are made correctly. Now comes the matter:
I want to split (or shard) the customers table horizontally:
As shown in these tables made in word:
I mean, I want to generate subtables... employeeA for a "branch" (Via España - virtual machine one) and employeeB for the other "branch" (5 de Mayo - virtual machine two). All this division is handled under the column "codemployee". In other words, each database has its respective employee table according to the branch where it is located. I've seen some videos on how to do fragmentation in SQLServer, MySql, but with Access, I haven't found anywhere...
I would appreciate your help
If I didn't misunderstand, what you need to do is create a table based on existing data in another table.
I don't have the version of Access you're working on so I can't test what I'm suggesting, but maybe by doing a little research on the following you can find a solution:
Create a make-table query
The following is a textual excerpt from the site to which the above link points (added at lois6b's suggestion).
On the Create tab , in the Queries group , click Query Design . Note: If you're using Access 2007, on the Create tab, in the Other group , you'll need to click Query Design .
In the Show Table dialog box , double-click the tables that you want to retrieve data from. Each table appears as a window in the top section of the query designer. Click Close when you are done adding tables.
In each table, double-click the fields that you want to use in the query. Each field appears in a blank cell in the Field row of the layout grid. This figure shows the layout grid with several table fields added:
Optionally add expressions to the Field row .
Optionally, add criteria to the Criteria row of the design grid.
Click Run to run the query and display the results in a datasheet.
If you want, modify the fields, expressions, or criteria, and then rerun the query until it returns the data you want to put in the new table.
Convert the select query
Open the select query in Design view , or switch to Design view. Access allows you to do this in several ways:
If the query is open in a datasheet, right-click the query's Documents tab and click Design View .
If the query is closed, in the navigation pane, right-click the query and click Design View on the shortcut menu.
On the Design tab, in the Query Type group , click Create Table .
The Create Table dialog box appears.
In the Table Name box , type the name of the new table.
- O well -
Click the dropdown arrow and select an existing table name.
Follow one of these procedures:
Put the new table in the active database
If the Active Database option is not already selected , click it, and then click OK .
Click Run and then Yes to confirm the operation.
Put the new table in another database
Click Other Database .
In the File name box , type the location and file name of the other database.
-or-
Click Browse , use the Create Table dialog box to locate the other database, and then click OK .
Click OK to close the first Create Table dialog box .
Click Run and then Yes to confirm the operation.
Try the following: Find a way to register the branch where they are either by their profile or by the ip of the machine that is at your discretion then create a function in an access module where the value of the branch id is returned , and in the access form by means of a query it sends to call the function the where should be something like this "WHERE id_Branch= myBranch()" this will make each one have the data required by its branches and there if they delete or delete they will only affect those within your range please notify me if this information helped you.