Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Importing data from an external text file into a field question

Status
Not open for further replies.

zootweller

Technical User
Oct 7, 2001
46
GB
I have a database that lists server names and their IP addresses for a large corporation. The main table lists the Host name, IP address & other aspects such as domain, role etc (this will be for webpages). To keep the IP addresses upto date, I have created a link table from the DNS servers' host file (delimeted text file, lists just the domain & ip addresses only).
I want to add the IP address from the link file into the main table for the relevent Host name, but only seem to be able to add it as a lookup selection list instead (not what I ordered!). Also, I want to be able to manualy add IP addresses into the main table where the server hasn't been listed in the DNS.

Can anybody offer any advice - please?!!
 
Since you have already linked the Hosts file, apparently successfully, you should just be able to create an Update query whose source consists of the main table joined to the linked table on host name, and whose target table is the main table. Drag the main table's IP Address field down to the grid, and in the Update To: line enter [linked table].IP address field name]. When you run the query, the IP addresses for all matching host names will be entered into your main table.

To enter IP addresses for missing hosts, you could just open the main table and update it, or you could use a simple form based on the main table if you prefer. If you use a form, you have the option of using a RunQuery call to run the update query in the form's Open event procedure. Then, each time you open the form you'll automatically refresh from the Hosts file first, rather than having to run the query separately.

How does that sound? Rick Sprague
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top