
export data from local txt file to .mdb file on server
You're wanting to do three things here, the first of which it sounds like
you've got:
1. find client side text file
2. upload client text file to server
3. process file on server to add to database
There are a number of ways to do part two, I recommend a file uploading
control you can install on the server, usually costs money (someone probably
knows of a good free one though) but it's simpler than doing it without. I
like SA-FileUp ( http://www.*-*-*.com/ ) some
other people use AspUpload from Persits Software, Inc
( http://www.*-*-*.com/ ). Your mileage may vary.
It is possible to upload a file with straight asp, without any com object,
but I've never done it. I suppose it works or the article wouldn't still be
there. where? here: http://www.*-*-*.com/
The next step is parsing your file into records in the database. There might
be a way to access accesses import functionality, but that would require
access to actually be installed on the server (which I personally do not
condone, there's no reason for it to be there) and it's probably a lot of
work. If we broke down step three (process file on server to add to
database) into two more steps, it might be easier:
3a. open and read file
3b. open and write rows in database
If you can open a file and read it in asp, you've got 3a done. If not, read
all about the file system object at http://www.*-*-*.com/ ;.
I see you can open a database in asp, but can you write records to the
tables in it? If not, you've got more learning to do... you could start at
http://www.*-*-*.com/ :) Hope this
helps!
By the way, if this is going to support more than a handful of users, you
should probably s{*filter*}the whole approach I just laid out, and move to an
n-tier design. Single-tier stuff like this doesn't go very far, but then
again, neither does using MS Access as a back end! :)
(I did a thing similar to this just a few months ago as a prototype, then
scrapped all the code and re-did the entire thing in ISAPI and many com
objects with SQL 2000 for the data store. It supports about 500 simultaneous
users now.)
Quote:
> I have created an .mdb file on our server and created a DSN and have
> made a connection to the database. What needs to happen is a user
> needs to use the browse button to find their txt file and then I need
> to take the information from the txt file (it is in columns that match
> the database) and import it into the access database for use by other
> webpages. I have a created an asp page that allows a user to browse
> and find a txt file (Input Type = File name=textfile). The user will
> click a submit button and the information from the txt file will be
> exported to the .mdb file. Is it possible to get the information from
> a local txt file into a .mdb file on the server? If so, how?!?
> Any help would be great.
> Catherine