Interacting between two access DBs (1 Viewer)

john_gringo

Registered User.
Local time
Today, 09:26
Joined
Nov 1, 2011
Messages
87
Hi,
I'm, I own two sapperate bussinesses running access DBs.
One is handling orders (company A) and the other one is handling storage and distribution (company B) . I am looking for a way the two BDs interact each other.
Let me explain.
1. Company A makes a bulk order for an amoumt of products. When products are received as stock from B and marked in the BD as received I need also the DB in A to be updates automatically.
2. When A need to send a product to a client automatically send a request to B in order to distribute the product.
At the moment I export a file with update data and import it to the other DB.
Is there a way to do it with a POST GET requests. I am using those requests with an external server with a REST API.
If yes how can I achieve this.
Is there other easy way?
With VPN or something?
Thanks
Jiannis
 

theDBguy

I’m here to help
Staff member
Local time
Yesterday, 23:26
Joined
Oct 29, 2018
Messages
21,467
Hi. If you're using an endpoint to make your requests, then the developers of that endpoint should be able to tell you if there are any API provisions to do what you're asking to do. Since we do not know what endpoints you're using, it would be hard to tell you what you can and can't do with it.
 

john_gringo

Registered User.
Local time
Today, 09:26
Joined
Nov 1, 2011
Messages
87
Hi... thanks for the reply.
What you mean end points. I am handling DBs by myself.
 

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Today, 01:26
Joined
Feb 28, 2001
Messages
27,167
OK, when you do your step 2, export/transport/import from A to B or from B to A...

How (mechanically) do you do that? Do you have a network connection between A and B? If so, what kind?

This answer will help us decide the best way to help you because it will tell us which tools in our tool kits we can use for you.
 

theDBguy

I’m here to help
Staff member
Local time
Yesterday, 23:26
Joined
Oct 29, 2018
Messages
21,467
Hi... thanks for the reply.
What you mean end points. I am handling DBs by myself.
Hi. Endpoints are the services where you submit your REST API requests.
 

Isaac

Lifelong Learner
Local time
Yesterday, 23:26
Joined
Mar 14, 2017
Messages
8,777
It would help if you specified what platforms these are. Are they Access databases? If so, the normal approach would be to link the Tables.
 

john_gringo

Registered User.
Local time
Today, 09:26
Joined
Nov 1, 2011
Messages
87
Hi. Endpoints are the services where you submit your REST API requests.
Good morning.
Don't have such services running on my part. I am using API to send data to the authorities on their server. They provide me with an API.
And I wondering if I can do something alike.
 

john_gringo

Registered User.
Local time
Today, 09:26
Joined
Nov 1, 2011
Messages
87
OK, when you do your step 2, export/transport/import from A to B or from B to A...

How (mechanically) do you do that? Do you have a network connection between A and B? If so, what kind?

This answer will help us decide the best way to help you because it will tell us which tools in our tool kits we can use for you.
I am exporting excel files and send them by emails. Then Importing them manually.
I can build a VPN maybe!
 

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Today, 01:26
Joined
Feb 28, 2001
Messages
27,167
If you can build a VPN then you can certainly set up a file transfer. For speed reasons, you MIGHT not care to direct-connect the DBs by having them map each other's table. A VPN can slow down operations pretty badly. But you can have A create your Excel file directly in the B folder and have code in B to look for a file of known name (or known wildcarded name). And of course, vice-versa.

Using e-mail as transport IS possible and there IS such a thing as having one program actually SEND the e-mail and another RECEIVE it, since you can build an Outlook Application object and use VBA to manipulate that object. Which includes creating and sending mails, looking into the INBOX for mails from a specific sender with a specific subject line, etc., and extracting an attachment to separate file.

The trick is, using application objects or file manipulation from VBA is - not difficult, but perhaps tedious. You do not indicate your level of comfort with VBA, so before sending you down a wandering garden path, I thought it might be better to inquire just how far you are willing to go in order to automate this process to its maximum. I would rather not give you a direction if it is one you weren't willing to follow.
 

john_gringo

Registered User.
Local time
Today, 09:26
Joined
Nov 1, 2011
Messages
87
If you can build a VPN then you can certainly set up a file transfer. For speed reasons, you MIGHT not care to direct-connect the DBs by having them map each other's table. A VPN can slow down operations pretty badly. But you can have A create your Excel file directly in the B folder and have code in B to look for a file of known name (or known wildcarded name). And of course, vice-versa.

Using e-mail as transport IS possible and there IS such a thing as having one program actually SEND the e-mail and another RECEIVE it, since you can build an Outlook Application object and use VBA to manipulate that object. Which includes creating and sending mails, looking into the INBOX for mails from a specific sender with a specific subject line, etc., and extracting an attachment to separate file.

The trick is, using application objects or file manipulation from VBA is - not difficult, but perhaps tedious. You do not indicate your level of comfort with VBA, so before sending you down a wandering garden path, I thought it might be better to inquire just how far you are willing to go in order to automate this process to its maximum. I would rather not give you a direction if it is one you weren't willing to follow.
Dear The Doc man. Highly appreciated your help.
Honestly, my skills are not that great but I've already managed to do a LOT with some help.
Your guide is quite interesting. I will try it I will ask for help when stuck.
I have already build a module to end auto emails.
I love to learn and am excited when I achieve coding thinks by myself.
Thanks again.
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 02:26
Joined
Feb 19, 2002
Messages
43,257
We still don't know if the databases are running on the same server. If they are not, then the exchange would be via FTP or email. You can set your Access database to check a specific mail folder when it opens and if the email is formatted precisely, extract the necessary data and update the database that opened the email.
 

john_gringo

Registered User.
Local time
Today, 09:26
Joined
Nov 1, 2011
Messages
87
We still don't know if the databases are running on the same server. If they are not, then the exchange would be via FTP or email. You can set your Access database to check a specific mail folder when it opens and if the email is formatted precisely, extract the necessary data and update the database that opened the email.
Dear Pat
First, thank you for your reply.
No, they are not on the same server. Does ftp need static IP? If so there is not. So email is one way.
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 02:26
Joined
Feb 19, 2002
Messages
43,257
I'm not sure about FTP needing a static IP. Download a tool and try it. Email is probably the easiest to implement, especially if your database is creating the email. You might even have it create a spreadsheet or csv file and send that as an attachment so you don't have to write parsing code.
 

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Today, 01:26
Joined
Feb 28, 2001
Messages
27,167
Since the points of action are on two different servers, you can break this problem down into a few discrete steps as a "divide-and-conquer" method. The divisive approach helps you break things down into achievable small parts that can then be reassembled into a functional whole.

Last bit of physical clarification: Do the two separate servers have a hard-line connection capability to each other? I.e. these are two different servers for two different companies. But since they are the same owner (YOU) are they in the same building or physically adjacent buildings?

Where I am going with this is that if you could establish a relatively short-run Ethernet connection between them, you could DIRECT-CONNECT the two databases to each other and never get involved with mail or FTP.

IF this cannot be done, but E-mail is still possible, then break this up this way:

1. Establish a format of some spreadsheet for A to send its transactions to B and for B to sent its transactions to A. As part of this, establish a naming convention for files such as the AtoBOrders or the BtoAUpdates. Perhaps with a fixed prefix and a date/time as part of the name. Then, using the FileSystemObject, you can tell Access to find files with names like AtoBOrders_*.XLS (the * being the wildcard). Or BtoAUpdates_*.XLS, for the other direction. In other words, you are building a "protocol" of data transfer.

2. Establish queries for each output so that you can do an Export to Excel. You want these queries to give you the rows of data that you need for the "other side" to be able to import the transactions. This query needs to have a table waiting on the other side (OR needs to be temporarily mapped as a table) so that the receiving side can bring it into Access, process it, and then abandon it. IF you can do it, the temporary mapping, though SLIGHTLY harder, will be less impacting on Access and general system resources. Not to mention that if you then break the connection once all has been processed, you can even use the FileSystemObject to rename and do a .MoveFile to a backup folder in case you need to review something or otherwise keep it separate as a record.

3. Decide which way you want to transfer the file between A and B, which could now be either E-mail or FTP or even the "thumb-drive" network - what us old-timers used to call "sneakernet."

3.a. IF it is possible to see each machine's directories from each other, you can use FileSystemObject to just DROP the file into a predetermined area on the other server. This might require your IT support team to help you set up the right kind of network permissions, but that should be a one-time action if that is what you do.

3.b If you must use FTP then you will need to look for a package that lets you know that you sent the file successfully, which AT WORST will involve trapping the FTP log file and reading it to look for a specific type of success message.

3.c. If you can use E-mail with a package (like Outlook) that lets you see incoming mail, then the trick will be that the sender must build a message with a who-cares text body, but it will have a very specific subject line and the file will be an attachment to the throw-away body. On the other side, you have to have a reader that looks in the INBOX for specific subject lines and processes those one at a time, extracting the attachments (see my #2 above).

There, that is the overview of how to approach this from 4 different ways - direct-mapping if possible, and 3a, 3b, 3c as ways to send the files.
 

john_gringo

Registered User.
Local time
Today, 09:26
Joined
Nov 1, 2011
Messages
87
I decided to go by mail as there must be pieces of evidence of what has been ordered to be shipped.
So mail is for me easier to handle and code.
I will share more details when done.
Thank you for your kind help.
 

Users who are viewing this thread

Top Bottom