Microsoft
Software
Hardware
Network
Question : Import text file - definition (field name, delimited, lng) based on a table
Hello,
Question - possible or not. I have been given the task of simplifying an import process. There are around 50 imports that need to be done 10-12 times. As opposed to using the import/export dialog box & wizard and saving the spec., the definition for each import is in a table. ex:
Field 1 - field name
Field 2 - data type
Field 3 - length
Field 4 - skip (y/n)
etc.
These tables basically simulate the import/export system table. There would be another table to assign the table name (name of the table to be created) and create it in another database. So, the whole process will be (maybe)...
1. Table definition is created for each import
2. text file resides in FTP folder
3. User open the database application and fills-out a form - specifies the path & .txt file, assigns the access table name and where it should go (path).
4. User clicks a button and the text file is import to "C:\MyDB.mdb"
Is there an easy solution to this? Did I provide enough info? I know they can use a saved file spec but they want it this way for easier editing.
Any ideas?
Thanks,
Pat
Answer : Import text file - definition (field name, delimited, lng) based on a table
You can indeed use CreateTableDef() to create tables directly into a specified database, but it's probably easier to execute a SELECT INTO query with an IN claues to copy the imported data from the current database into the other database.
Random Solutions
iframed page to finish without being in an iframe
How to Delete a Folder or File from the Registry
X3500 IBM Server Keeps Powering Off After Post
Lenovo R52 dead, won't power on
Use an unbound column from a combo box
Ubuntu 10.04 generic or virtual kernel for XenServer?
Connect to SQL Server database dynamically with ASP.net
Access-list
Hi-Def TV
Generate report/query from sample data