Hi All,
I was wondering if someone could take the time to give me a few clues on the best way to go about this problem programatically.
Attached is a text file that is exported from a soil moisture monitoring program. I want to get the soil moisture measurements in to my access 2000 database. So far I have been able to do a TransferText command to get the data from the text file to a table in Access. I discovered the Save Specifications thing when manually importing to then be used for automatically importing so rows aren’t dropped out if the info is a bit dodgey.
DoCmd.TransferText acImportDelim, "MoistImpSpec", "MoistImp", "C:\Program Files\VinRec\MoistureData.txt"
Later I will use a dialog control etc in place of the actual files path and name.
The table structures in my access program that I need this text file data to get into are
TableSiteInfo
SiteID autonmuber
SiteName Text
TableMoistureData
Moist ID autonumber
Date Date/Time
Hour Date/Time
SiteNameID Long Integer
Reading1 number
Reading2 number
Reading3 number
Reading4 number
But I can change it if its not good?
So, my dilemma is, each site has 4 sensors, the text file lists the data with each moisture reading in its own column despite the SiteName and the sensors are called Sensor1, Sensor2, sensor3, sensor4, sensor5 etc despite its site name. How do I get the site info into my access table for storing the soil moisture data? And how then, do I get the actual data for each site in matching up. I will also need it to tell the user if a sitename doesn't exist in the access database.
This text file is only a small example of what the soil moisture program can do, it can hold information for 100 sensors.
Any ideas on how to go about this would be greatly appreciated. And thankyou very much to all who have a look. I don't expect a whole solution but if you feel like giving one I would love it. I need a push in the right direction.
Kind regards,
Rachael
I was wondering if someone could take the time to give me a few clues on the best way to go about this problem programatically.
Attached is a text file that is exported from a soil moisture monitoring program. I want to get the soil moisture measurements in to my access 2000 database. So far I have been able to do a TransferText command to get the data from the text file to a table in Access. I discovered the Save Specifications thing when manually importing to then be used for automatically importing so rows aren’t dropped out if the info is a bit dodgey.
DoCmd.TransferText acImportDelim, "MoistImpSpec", "MoistImp", "C:\Program Files\VinRec\MoistureData.txt"
Later I will use a dialog control etc in place of the actual files path and name.
The table structures in my access program that I need this text file data to get into are
TableSiteInfo
SiteID autonmuber
SiteName Text
TableMoistureData
Moist ID autonumber
Date Date/Time
Hour Date/Time
SiteNameID Long Integer
Reading1 number
Reading2 number
Reading3 number
Reading4 number
But I can change it if its not good?
So, my dilemma is, each site has 4 sensors, the text file lists the data with each moisture reading in its own column despite the SiteName and the sensors are called Sensor1, Sensor2, sensor3, sensor4, sensor5 etc despite its site name. How do I get the site info into my access table for storing the soil moisture data? And how then, do I get the actual data for each site in matching up. I will also need it to tell the user if a sitename doesn't exist in the access database.
This text file is only a small example of what the soil moisture program can do, it can hold information for 100 sensors.
Any ideas on how to go about this would be greatly appreciated. And thankyou very much to all who have a look. I don't expect a whole solution but if you feel like giving one I would love it. I need a push in the right direction.
Kind regards,
Rachael