Results 1 to 12 of 12

Thread: .dat files

  1. #1
    Join Date
    Nov 2004
    Posts
    20

    Unanswered: .dat files

    other than using text/html editors, what programs should i use to load .dat files properly. and also, more importantly, is it possible to export/convert microsoft access files/tables/queries into .dat format files. if so, how can it be done?

  2. #2
    Join Date
    Jun 2005
    Location
    Richmond, Virginia USA
    Posts
    2,763
    Provided Answers: 19
    The DAT file extention is used by a number of unrelated programs for totally different file formats. The most common use, I think, would be data files for Microsoft basic programs, in their various incarnations, up to and including Visual Basic. These files utilize fixed length fields, and if you're dealing this type of file you need to remember this. They are not delimited with a comma or quotes or anything like that. I've imported them into an Access table, but it wasn't an simple process, and I was doing it as a one time thing to move data from a QickBasic program I was porting into Access. As for exporting from Access to DAT file, I have no idea. Exactly where are you getting these files from?
    Hope this helps!

    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

  3. #3
    Join Date
    Oct 2003
    Location
    Ger
    Posts
    1,969
    Provided Answers: 1
    Uset the DoCmd.OutputTo to issue .dat files

  4. #4
    Join Date
    Oct 2003
    Location
    Ger
    Posts
    1,969
    Provided Answers: 1
    Example
    DoCmd.OutputTo acOutputTable, yourTableName2bExported, acFormatTXT, "c:\yourOutPut.dat"

  5. #5
    Join Date
    Nov 2004
    Posts
    20

    .dat files

    where do i use this example code in ms access?

  6. #6
    Join Date
    Oct 2003
    Location
    Ger
    Posts
    1,969
    Provided Answers: 1
    You can make a command button on your form to export your table.
    Put the code in the kon click event of the button....

  7. #7
    Join Date
    Nov 2004
    Posts
    20

    .dat files

    i tried everything you told me and used the code for the onclick event but the error appears to be with the acFormatTXT bit of the code. what do i use instead?

  8. #8
    Join Date
    Oct 2003
    Location
    Ger
    Posts
    1,969
    Provided Answers: 1
    You can also use

    DoCmd.TransferText acExportDelim, , "Emp", "C:\Txtfiles\Emp.txt"
    Where Emp is the table name you want to export....

  9. #9
    Join Date
    Oct 2003
    Location
    Ger
    Posts
    1,969
    Provided Answers: 1
    Also try
    DoCmd.OutputTo acOutputTable, "Emp", acFormatRTF, "c:\Emp.dat"

    Where Emp is the table name you want to export....

  10. #10
    Join Date
    Nov 2004
    Posts
    20

    .dat files

    thank you very much for the code, it really, really helped. but is there a way as such to import .dat files into ms access and if so, how can it be done?

  11. #11
    Join Date
    Oct 2003
    Location
    Ger
    Posts
    1,969
    Provided Answers: 1
    Try
    DoCmd.TransferText acImportDelim , TableName2ImportDataIn, FileName2ImportDataFrom

  12. #12
    Join Date
    Oct 2003
    Location
    Ger
    Posts
    1,969
    Provided Answers: 1
    You can have a look to the help of TransferText

Posting Permissions

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