Importing/linking csv files

Ian Mac

Registered User.
Local time
Today, 23:36
Joined
Mar 11, 2002
Messages
179
All,

Sorry for the vague title compared to the problem I have.

I am automating a process where the user Imports a CSV file abd then runs several queries abd deleting the Imported file.

What I would like is the equivalent of Excel's GetOpenFileName dialogue box.

In essence, I would like the user to hit a 'Import new data button' and for a the open file dialogue to Open and to store the filename and Path in variables (1 each) to code the SQL and do all the other wizzy stuff.
I will be using these variables to do the actual Import, it more a visable selection for the user.

I hope that makes sense, I just want to get the path and filename of the file they select, I'll do all the other stuff.

Cheers.

PS. Is there a way to do what I need without it actually pulling the data in and bloating the Database (seen as I'm deleting the table once I've moved the imformation around), or any tips on stopping/limiting this type of bloatiness

Thanks,
 
I think this is what you want

Here's some code I used... I forget where I got it from, but I think its all in the documentation in the macro section... Anyway, this allows you to go choose a file from Access to import. It actually pulls the path and the file name.

Take a look... its pretty neat... I don't understand the whole thing but luckily I don't have to:) I just use it and you can too. In the code you can see where it saves the the path and file names as seperate variables.... I am using it for almost exactly the same reasons you seem to want this.

GL
Gary
 

Attachments

Thank you both very much.

The second one is a extention of the first. It contains somethoings I will definately tweak.

If anyone is interested, I have adapted the code to do what I want but I have gone with Linking the file concerned and Deleting the object after to procedure has ran, rather then actually Import the files which would just take up space.

Now, does anyone know where I get a progress bar example that progresses with each query (7 thoughout the whole process (all in code))? (I'm going to ask this question seperately but thought I would stick it on here too)

Thanks again
 

Users who are viewing this thread

Back
Top Bottom