Is it possible to remotely start an import on machine "A" when a text file on machine "B" is modified? I can setup linked tables and run the following,...
qry_ManifestUpdateAndInsert: - UPDATE tbl_tempManifest AS tm LEFT JOIN tbl_Manifest AS m ON tm.tracking=m.tracking SET m.name = tm.name, m.store = tm.store, m.orderNum = tm.orderNum, m.tracking = tm.tracking;
but not sure how to setup a "trigger" if you will to let machine "A" know the text file has been updated. Open for suggestions, even more open for suggestions that would not require a linked table. I would like machine "B" to have control, machine "B" can be windows XP or linux.
Thanks!
3 1875 ADezii 8,834
Recognized Expert Expert
Assuming Machine B can ' see' the Text File on Machine A: - Create a Form in a Database on Machine B.
- Create the following 2 Form Level Variables:
- Dim strFileToCheck As String
-
Dim varFileDateTime As Variant
- Open the newly created Form either Hidden or Minimized, and initialize the 2 previously Declared Variables in the Open() Event:
- Private Sub Form_Open(Cancel As Integer)
-
strFileToCheck = "T:\Stuff\Test.txt" 'a Shared Drive on Machine 'A'
-
varFileDateTime = FileDateTime(strFileToCheck)
-
End Sub
- Set the Form's Timer Interval to 30000 (30 seconds), and in the Timer() Event place the following code:
- Private Sub Form_Timer()
-
If varFileDateTime <> FileDateTime(strFileToCheck) Then
-
'initiate UPDATE Operation here
-
varFileDateTime = FileDateTime(strFileToCheck) 'reset
-
End If
-
End Sub
- When the Form Opens, the Variables will be initialized, the File's (Test.txt) Date/Time Stamp will be stored in the Variable. Every 30 seconds, the File's Date/Time Stamp will be checked against the previously stored Value. If they differ, the File was Modified, perform the Update Operation, Reset the Variable (varFileDateTime), and then start all over with the 30 second cycle.
- Make the necessary adjustments to suit your specific needs.
- The following was only Theory, will it work? I'll leave that up to you.
Sweet! Thanks for the help ADezii. I'll give this a shot next chance I get.
Another job well done. Client has a front end, Server (code below) monitors and updates on filechange. Here's the code... -
Option Compare Database
-
Dim strFileToCheck As String
-
Dim varFileDateTime As Variant
-
-
-
Private Sub Form_Open(Cancel As Integer)
-
-
strFileToCheck = "c:\inetpub\ftproot\inhouseman.txt"
-
varFileDateTime = FileDateTime(strFileToCheck)
-
-
End Sub
-
-
Private Sub Form_Timer()
-
Dim strSQL As String
-
-
If varFileDateTime <> FileDateTime(strFileToCheck) Then
-
DoCmd.SetWarnings False
-
DoCmd.TransferText acImportDelim, "InHouseManImportSpecs", "tbl_tempManifest", "c:\inetpub\ftproot\inhouseman.txt", False
-
DoCmd.OpenQuery "qry_ManifestUpdateAndInsert"
-
-
strSQL = "DELETE * FROM tbl_TempManifest"
-
DoCmd.RunSQL strSQL
-
DoCmd.SetWarnings True
-
-
Me.txtUpdated.Value = Now()
-
'MsgBox "The file has been modified!"
-
varFileDateTime = FileDateTime(strFileToCheck)
-
Else
-
Me.txtActivity.Value = Now()
-
'MsgBox "The file is the same!"
-
End If
-
-
-
End Sub
-
Thanks for pointing me in the right direction ADezii!
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Chris |
last post by:
Background: I am using a MS Access 2000 front end with SQL Server 8.0
back end.
I have the requirement to import all text files (regardless of
filename) from a given folder on the network into a table within SQL
Server. This import needs to run continuously, as more text files
will be saved in the folder by a separate system and they need...
|
by: shumaker |
last post by:
I don't need a detailed description of a solution(although I wouldn't
mind), but I am hoping someone could tell me in general the best path
to go about accomplishing a task, since I don't know all the
capabilities of what I have available. I can learn the details myself
I think. I am trying to set this up to be as simple to use as possible...
|
by: klowe |
last post by:
Hi, I'm an Access newbie and need to update an Access database from a
web application. I'll need to add new records and also update existing
ones.
What I was thinking of doing is have my web app create a text file with
Access SQL INSERT/UPDATE statements and get Access to import and
execute this file.
Is this possible?
|
by: Raterus |
last post by:
Hi, I'm after this setup, and I'm just wondering if this is even feasible.
I'd like to store my asp.net project remotely, on a network drive (all the project files, everything), But I want to be able to run the project on my local computer, off my local IIS server/asp.net configuration.
Here is what I've done, I've set up an IIS virtual...
|
by: John |
last post by:
Hi
We have our web site remotely hosted by a service provider. We need to, from
time to time, remotely upload transactions to the site from our office
vb.net app. The question is how can I connect to the remote site's sql
server using vb.net? Do I need to use a control etc.? What if I want to post
values as parameters to an asp.net page?
...
| |
by: ghadley_00 |
last post by:
Hi,
I have a MS access database table for which I regularly need to import
fixed width text data. At present I have to to cut and paste the text
data from its source to a text file, save the file, import the text
file as fixed width text , and then run
an update query to copy the appropriate info into fields of a different
table.
Is it...
|
by: taylorjonl |
last post by:
I am completely baffled. I am writting a daemon application for my
work to save me some time. The application works fine at my home but
won't work right here at work. Basically I have a MainForm what has a
Start/Stop button that starts and stops the processing thread.
private void StartButton_Click(object sender, System.EventArgs e)
{...
|
by: Dave G |
last post by:
I will shortly be receiving data in the form of a text file, like this:
id: 123456
first name: Fred
surname: Bloggs
age: 26
and so on, for about 60 fields. Each line ends with a carriage
return/line feed.
|
by: =?Utf-8?B?Vmlua2k=?= |
last post by:
Hello Everyone,
I have an exe application that I want to start remotely.Once I start the
application,
I want to press ok to that application. To start the application, I did
Process.start("C://test/app.exe"). I am writing this code in a C# web
application, famework 1.1
How can I press ok to that started application.
Any help will be...
|
by: Bill Schanks |
last post by:
I have a winform app (VB 2005) that allows users to export data to
excel, make updates to the excel file and import the data from that
Excel file and update the database.
My question is: Is it best to do it this way, calling the update
stored procedure for every update? Or should I be loading this data
into a staging table, and if all goes...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language...
| |
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in...
| |
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |