Converting Date/Time from Access to MySQL

Results 1 to 2 of 2

Thread: Converting Date/Time from Access to MySQL

  1. #1
    Join Date
    Dec 1969

    Default Converting Date/Time from Access to MySQL

    Hello,<BR><BR>I need to program a VBScript, that imports data to a MySQL database from a Microsoft Access database. The problem is the date/time format.<BR>Since I come from Germany, the native date/time format is " hh:mm:ss". This is not compatible to the MySQL date/time.<BR>I used the script presented in the ASPFAQs to convert the date, but it is simply too slow. There are around 10000 records to convert, each with around 6 date/time values, and this takes more than one and a half hour to process (I think, because the script never ran so long without crashing...)<BR>Changing the date/time-format of the operating system does not help and is not appropriate to the task.<BR>System is a IIS5.0<BR><BR>Hopefully someone can help me.....<BR><BR>Thanks,<BR><BR>goofy

  2. #2
    Join Date
    Dec 1969

    Default WHAT script in the FAQs???

    But I just had a thought: *PURPOSELY* change to using a different LCID!<BR><BR>For example, the date/time format in Japan is<BR> yyyy-mm-dd hh:mm:ss<BR>and that *IS* compatible with MySQL!<BR><BR>So you could do<BR>&#060;%<BR>Session.LCID = &h0411 &#039; I think that&#039;s the Japanese LCID<BR>...<BR>Do Until accessRS.EOF <BR> ... get a record ...<BR> mySQLdate = CStr( RS("someDateTimeField" )<BR> ... build up the MySQL INSERT ...<BR> mysqlConn.Execute SQL<BR> accessRS.MoveNext<BR>Loop<BR>%&#062;<BR><BR>You could possibly also do this via a stored query in Access, if you can get Access to think you are using a Japanese LCID.<BR><BR>More than likely, the MySQL driver won&#039;t understand and won&#039;t care about the LCID, so you should be okay.<BR><BR>Probably would be better off doing this WITHOUT ASP, though. See if you can&#039;t figure out how to link to the MySQL DB from Access and then do it all in Access.<BR><BR>

Posting Permissions

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