473,513 Members | 2,552 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Remotely start import on text file update.

aas4mis
97 New Member
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:
Expand|Select|Wrap|Line Numbers
  1. 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!
Feb 26 '10 #1
3 1875
ADezii
8,834 Recognized Expert Expert
Assuming Machine B can 'see' the Text File on Machine A:
  1. Create a Form in a Database on Machine B.
  2. Create the following 2 Form Level Variables:
    Expand|Select|Wrap|Line Numbers
    1. Dim strFileToCheck As String
    2. Dim varFileDateTime As Variant
  3. Open the newly created Form either Hidden or Minimized, and initialize the 2 previously Declared Variables in the Open() Event:
    Expand|Select|Wrap|Line Numbers
    1. Private Sub Form_Open(Cancel As Integer)
    2.   strFileToCheck = "T:\Stuff\Test.txt"       'a Shared Drive on Machine 'A'
    3.   varFileDateTime = FileDateTime(strFileToCheck)
    4. End Sub
  4. Set the Form's Timer Interval to 30000 (30 seconds), and in the Timer() Event place the following code:
    Expand|Select|Wrap|Line Numbers
    1. Private Sub Form_Timer()
    2.   If varFileDateTime <> FileDateTime(strFileToCheck) Then
    3.     'initiate UPDATE Operation here
    4.     varFileDateTime = FileDateTime(strFileToCheck)    'reset
    5.   End If
    6. End Sub
  5. 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.
  6. Make the necessary adjustments to suit your specific needs.
  7. The following was only Theory, will it work? I'll leave that up to you.
Feb 27 '10 #2
aas4mis
97 New Member
Sweet! Thanks for the help ADezii. I'll give this a shot next chance I get.
Mar 2 '10 #3
aas4mis
97 New Member
Another job well done. Client has a front end, Server (code below) monitors and updates on filechange. Here's the code...
Expand|Select|Wrap|Line Numbers
  1. Option Compare Database
  2. Dim strFileToCheck As String
  3. Dim varFileDateTime As Variant
  4.  
  5.  
  6. Private Sub Form_Open(Cancel As Integer)
  7.  
  8.     strFileToCheck = "c:\inetpub\ftproot\inhouseman.txt"
  9.     varFileDateTime = FileDateTime(strFileToCheck)
  10.  
  11. End Sub
  12.  
  13. Private Sub Form_Timer()
  14. Dim strSQL As String
  15.  
  16.     If varFileDateTime <> FileDateTime(strFileToCheck) Then
  17.         DoCmd.SetWarnings False
  18.         DoCmd.TransferText acImportDelim, "InHouseManImportSpecs", "tbl_tempManifest", "c:\inetpub\ftproot\inhouseman.txt", False
  19.         DoCmd.OpenQuery "qry_ManifestUpdateAndInsert"
  20.  
  21.         strSQL = "DELETE * FROM tbl_TempManifest"
  22.         DoCmd.RunSQL strSQL
  23.         DoCmd.SetWarnings True
  24.  
  25.         Me.txtUpdated.Value = Now()
  26.         'MsgBox "The file has been modified!"
  27.         varFileDateTime = FileDateTime(strFileToCheck)
  28.     Else
  29.         Me.txtActivity.Value = Now()
  30.         'MsgBox "The file is the same!"
  31.     End If
  32.  
  33.  
  34. End Sub
  35.  
Thanks for pointing me in the right direction ADezii!
Mar 5 '10 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

1
5882
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...
10
2546
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...
16
3272
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?
2
1687
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...
7
1192
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? ...
1
3755
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...
5
2201
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) {...
3
2430
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.
2
3870
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...
5
2895
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...
0
7178
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...
0
7565
jinu1996
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...
1
7128
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...
0
5704
agi2029
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...
1
5103
isladogs
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...
0
4759
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...
0
3255
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...
0
1612
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
1
817
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.