Results 1 to 2 of 2

Thread: attaching text files to defined tables in access

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Aug 1999
    Location
    UK
    Posts
    300
    HI !

    I want to know if it is possible to attach / link two files to a table.

    Here is my code at the moment:

    Set tdf = reeldata_db.CreateTableDef("qcstore")
    tdf.Connect = "text;database=c:\reeldata_project\;"
    tdf.SourceTableName = "qcdata.txt"
    reeldata_db.TableDefs.Delete ("qcstore")
    reeldata_db.TableDefs.Append tdf



    the table is called qcstore and is set up in the DB already.
    I am currently adding the file qcdata.txt to this table but now have had a request to add a second file called L53qcdata.txt to this table as well. Can I add two files at the same time ?
    I tried this but it didn't work:
    tdf.SourceTableName = "qcdata.txt" & "l53qcdata.txt"
    but it crashed out and didn't like it. The txtfiles are all in the same directory.

    Any help would be great.
    Locutus
    Resistance is futile

  2. #2
    Addicted Member
    Join Date
    Jul 2000
    Location
    Scotland
    Posts
    184
    Could you not simply call it twice as shown below?

    Code:
    Set tdf = reeldata_db.CreateTableDef("qcstore") 
    tdf.Connect = "text;database=c:\reeldata_project\;" 
    tdf.SourceTableName = "qcdata.txt" 
    reeldata_db.TableDefs.Delete ("qcstore") 
    reeldata_db.TableDefs.Append tdf 
    
    tdf.SourceTableName = "L53qcdata.txt " 
    reeldata_db.TableDefs.Append tdf
    or merge the two files first.........

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width