Me again! (1 Viewer)

Steve Bremner

Registered User.
Local time
Today, 21:36
Joined
Jul 16, 2003
Messages
34
Another question for you.
I run an IM app, which uses a .txt file to display messages.
I want to make an access front end so that it is a little easier to update. I have tried to import the .txt file as a table, but it decides to have 40+ fields.
Any ideas how I could achieve this? Is it possible to have the .txt file in it's original location, and just have access updating the file?
This would be easier than having to recode the app to take the update from the DB.

Thanks
 

Fizzio

Chief Torturer
Local time
Today, 21:36
Joined
Feb 21, 2002
Messages
1,885
What does the IM stand for? (not that it has an impact on the answer - just curious)

A lot depends on the format of your text file. Access is 'guessing' how the flat file is structured and obviously getting it wrong - but you can help it with the import wizard. The structure of the textfile may make it inefficient to import into access. Post an example of the structure of your text file.

Access can update your text file but the easiest way would be to import and update within the Db.

Also, can you recode the app to accept a different format of text file if the one you have is not easily processed by Access
 

Steve Bremner

Registered User.
Local time
Today, 21:36
Joined
Jul 16, 2003
Messages
34
Fizzio said:
What does the IM stand for? (not that it has an impact on the answer - just curious)

Instant Messenger. It pops up when there are any major IT issues.

What file type would be easier for Access to process?
 

Fizzio

Chief Torturer
Local time
Today, 21:36
Joined
Feb 21, 2002
Messages
1,885
It is not really the file type, Access can handle most types of files but it is the format of the textfile that is no doubt confusing access.

For example, a common format is CSV where each value is separated by a comma (or other delimiter).

Post a bogus example of your file in the same format that it is currently in if confidentiality is an issue.
 

Steve Bremner

Registered User.
Local time
Today, 21:36
Joined
Jul 16, 2003
Messages
34
I have no idea what you mean, however, this is the file I want to update.
 

Attachments

  • mfm.txt
    152 bytes · Views: 110

Fizzio

Chief Torturer
Local time
Today, 21:36
Joined
Feb 21, 2002
Messages
1,885
Access has no problem importing this type of file as essentially you only have one field (your message) and multiple records (each line). I would import this as a fixed column file and not a delimited file as if you have punctuation in any text, if you set this as the delimiter (or even spaces for that matter), it will define it as a new field.

In your case though, as you want to make this a dynamic process, I would actually link this text file as a table rather than import/export. Then any changes you make in the table will be reflected in the text file.

Does this help?
 

Steve Bremner

Registered User.
Local time
Today, 21:36
Joined
Jul 16, 2003
Messages
34
Right,

I have set up the table with the same paramaters as the .txt file. All the forms are working fine, and are updating the tables.
Now, how do I link that table to a .txt file on the network? So that when the table is updated, the .txt file is dynnamically updated also?
 
Last edited:

Fizzio

Chief Torturer
Local time
Today, 21:36
Joined
Feb 21, 2002
Messages
1,885
You do not actually link the textfile to the table you have created, you actually create a linked table from the textfile (even though they sound the same!)

In the database window, go to File - Get External Data - Link Tables

The browse window will then come up - Set the file type to Text Filkes, find your text file, set it to fixed width (remove all the breaks it will no doubt suggest) and press OK. (may have missed a step or two?)

You will then have a table that looks like a notepad in your table list. Base your forms on that and any changes you make in the form will be reflected in the text file.
 

Steve Bremner

Registered User.
Local time
Today, 21:36
Joined
Jul 16, 2003
Messages
34
No longer works a treat I'm afraid.
Because Access uses the file, and the app uses the file, there is somesort of sharing violation.
When I log on to the database it checks the txt file and kicks everyone else out of the application.
Any ideas?
 

Fizzio

Chief Torturer
Local time
Today, 21:36
Joined
Feb 21, 2002
Messages
1,885
Oh well:(

You will just have to resort to the import and export method unfortunately. If you want to automate this process, search these forums for Import Text File and there should be enough info there to get you started.

You will need to use the transferText method and define an import specification but there should be enough help here.
 

Steve Bremner

Registered User.
Local time
Today, 21:36
Joined
Jul 16, 2003
Messages
34
Yeah, I managed to set that up, however, it exports the name of the feild and the messgage. For Example.

---------------------------------------------------------------------------------
|________________FIELD NAME________________________|
| |
| The messge would then go here |
---------------------------------------------------------------------------------

How would I get rid of this? I have tried to run it from a query rather than a table to see if I can edit it in anyway but It doesn't want to play!
;)
 

Fizzio

Chief Torturer
Local time
Today, 21:36
Joined
Feb 21, 2002
Messages
1,885
I cannot remember off the top of my head - I'm sure in the export specs you can specify not to export the field name. I have not got access to Access at the minute but I will post back when I do (Unless anyone dives in and saves my bacon:) )
 

Users who are viewing this thread

Top Bottom