Results 1 to 2 of 2

Thread: [Solved] Save DateTime to .csv for import into MS Access

Threaded View

  1. #1

    Thread Starter
    New Member
    Join Date
    May 2010
    Posts
    3

    [Solved] Save DateTime to .csv for import into MS Access

    My program outputs outputs a bunch of stuff to .csv files, which are destined to eventually be imported into MS Access. Now, everything works great except that I can't seem to figure out a way to save some DateTime variables that Access likes.

    First, I've tried using .ToOADate().ToString to print out the double that is used to represent the date. This actually works if I create a table in Access with all the columns and their types set, then append the data in the file to that. However, it does not work if I import the file as a new table and in the import wizard manually set the column type to Date/Time. I just get a type conversion error in that case.

    I've also just tried using .ToString to print out the string representation, but that also gives me a type conversion error during import.

    Is there a way to print my DateTime variable out so that it'll work both with creating new tables and appending to existing tables?

    Thanks.
    Last edited by zebeste; Jul 8th, 2010 at 05:51 PM. Reason: solved

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