how to create a mdb file from the flat file through an automated process?

From: Rob (anonymous_at_discussions.microsoft.com)
Date: 06/23/04


Date: Tue, 22 Jun 2004 19:10:17 -0700

Short of reverse engineering the Access file format, I
don't think this is possible without having some sort of
programming running inside Access or an EXE (VB or C++).

One crude work around I can think of would be to create an
Access "template" file with your manual import process
encoded in it (either through a Macro or via VBA).

Then, when you wanted to create your new .mdb file
populated with the CSV data, first copy this raw
template .mdb to another new .mdb file, then launch the
new .mdb file with the command line parameter set to run
the code that will automatically import the CSV file (this
could be by running a Macro or by having some code
attached to a form, if you encoded your import process in
VBA).

This is a bit convoluted, but you can make it work without
human intervention. You will need to look up "command
line" in the Access help file to read up on the Startup
Command Line Parameter options, and probably use the Shell
command if you will be lauching all of this from within
another Access database. Without knowing more about your
situation, I can't be more specific.

I'm pretty sure this could all be done directly via VBA
code, too, and it might even be more robust. The first
step would be importing the CSV file (as above), then
programatically creating a new database object (the
new .mdb file), and finally copying the newly imported
table into this object.

That would be a better question for the Programming
newsgroup, though. I'm learing Java, and it's has totally
corrupted my recollection of Access' Object model.

HTH

Rob

Rob

>-----Original Message-----
>Let me explain this in detail. I have a skeleton database
>with the data dictionary (necessary tables) created. I
>need to create a new mdb file from the data from csv
file.
>I do know how to do in access interactively. But I like
to
>do this without even opening the access.
>Please help me.
>
>>-----Original Message-----
>>Hi,
>>how to create a mdb file from the flat file (csv )
>through
>>an automated process? Thanks.
>>
>>
>>.
>>
>.
>



Relevant Pages

  • RE: script to compact database VBS
    ... If you go with the command line, its just a matter of creating a short cut ... compact this db every time it opens? ... ' Set a name and path for a temporary mdb file ... 'Set objAccess = CreateObject ...
    (microsoft.public.access.modulesdaovba)
  • Some things that do work only when I am on connected to internet
    ... I have a .NET web application. ... the connectionString is something like: ... or just even simple command: ... It seems that things don't work well to the *.mdb file (maybe some ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Object variable or With block variable not set
    ... I am doing some new work on it and opened up the form - to add a new command ... The command button wizard attempts to ... button for, Navigation, Open a Form, Run a Report, etc., but there is no ... I tried a new .mdb file, new form, new button. ...
    (microsoft.public.access.formscoding)
  • Re: convert .csv to .mdb file using ms-access
    ... Strictly speaking, you cannot convert a .csv file to an .mdb, because whereas a .csv file contains only some text, an .mdb file is much more than that. ... If this is going to be a regular process, you could create a macro or VBA procedure to automate the task. ...
    (microsoft.public.access.externaldata)
  • Re: do not have exclusive access; cant save design changes
    ... mdb file, ... Click the arrow and choose Open Exclusively. ... If you don't include Access in the command line, ... "Mark Hammer" wrote in message ...
    (microsoft.public.access.formscoding)

Loading