Re: transfer data into an external database
- From: John Nurick <j.mapSoN.nurick@xxxxxxxxxxxxxx>
- Date: Wed, 01 Jun 2005 20:05:41 +0100
Hi Alan,
As the Irishman said, I wouldn't start from there if I were you. Instead
I'd either
- set up a linked table in Control.mdb connected to the table in
BigTables, and also move the import module and import specification from
BigTables.mdb into Control.mdb. The code in the module might need
revising.
- do the import by executing a query in Control.mdb. The query would
look something like this:
INSERT INTO MyTable IN D:\Folder\BigTables.mdb
SELECT *
FROM [Text;HDR=YES;Database=D:\MyFolder\;].MyFile#txt
If the import specification is really necessary (often they aren't with
CSV files) I'd replace it with a schema.ini file in the same folder as
the CSV file. Schema.ini is documented towards the end of the help
article "Initializing the Text Data Source Driver" in Microsoft Jet SQL
help. See also:
Create a Schema.ini file based on an existing table in your database:
http://support.microsoft.com/default.aspx?scid=kb;EN-US;155512
On Wed, 1 Jun 2005 08:41:06 -0700, "Alan UK"
<alanuk@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote:
>I have a database that contains large tables (BigTables.mdb) and a module to
>import a csv file using an import specification.
>I want to run this module and populate this database by running code in a
>different database (Control.mdb) where the queries on the tables sit. To be
>clear I want to refresh BigTables.mdb with the csv file, not Control.mdb
>I understand the code that calls queries in the external database using DAO,
>and have tried to call the module using a similar technique and placing a
>reference to BigTables.mdb into Control.mdb
>
>Dim db As DAO.Database
>Set db = DBEngine.Workspaces(0).OpenDatabase _
> ("D:\BigTables.mdb")
>BigTables.[test2].Importatron1
>Set db = Nothing
>
>Unfortunately this runs the import into Control.mdb, so I get a new and
>unwanted table there instead of in BigTables.mdb.
>Can someone please tell me where this is going wrong, or if another method
>is more appropriate?
>
>Thanks for your assistance
>
>[*Please* don't refer me to any help files on this matter, however, as
>neither my machine at home nor at work seems to be able to access these help
>files. I have checked
>MS DAO 3.6 Object Library and
>MS ADO Ext. 2.5 DLL for Security
>in the object library references - is there something else that needs a
>check before this will work or the help files are viewable for related topics?
>I apologise that this was also posted elsewhere, but failed to get a
>response that helped]
--
John Nurick [Microsoft Access MVP]
Please respond in the newgroup and not by email.
.
- Follow-Ups:
- Re: transfer data into an external database
- From: Alan UK
- Re: transfer data into an external database
- References:
- transfer data into an external database
- From: Alan UK
- transfer data into an external database
- Prev by Date: Re: Importing text from Excel into Access changes it to exponentia
- Next by Date: Re: Using Macro to open tools
- Previous by thread: transfer data into an external database
- Next by thread: Re: transfer data into an external database
- Index(es):
Relevant Pages
|
Loading