Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
DBF-TO-MySQL Datetime Problem
Message
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
01135345
Message ID:
01135852
Views:
22
Hello, John, and thanks for the reply.

John wrote:
>Randall,
>you most likely need to change the date format in VFP before importing/exporting
>the data. Here is the procedure we use. You want to set it to the MySQL type just
>before the import/export and set it back to default right after.

Sounds good. We'll give this a shot. We did get something to work, but
it's not the best solution out there. Can you say -- AHEM -- Kludge! I
knew you could :). For our situation, it's pragmatic, though.


Currently, we're doing this:

* NaviCat to copy all of the tables with incorrect datetime fields.
(We're going to try and see if we can automate this process using
Intelligent Coverter's "DBF-To-MySQL" command-line interface.)

* Using VFP, connect to MySQL via SQLSTRINGCONNECT(), and then update
the tables using SQLEXEC("UPDATE TABLE SET...") etc.

This is the long way around the problem, but it's a quick hack to
get things going somewhat manually until Sameer (other proger) and I can
write a real DBF-to-MySQL converter accessable from VFP that treats our
data correctly.

>One more thing, this is for the datetime data type. NOT the timestamp.
>Timestamp is a differnt data type in MySQL.

Okay. We'll be sure to keep that in mind.


BTW, your code says:

* Written to change and restore the date format to the type needed
* to export/import MySQL Text Files.

Are you saying that you're doing this via dumpfiles and MySQL
scripts? If so, I think we're talking about two different things
here. If I'm not mistaken, NaviCat would be using ODBC to pull
things off, and it just so happens that datetime data types are
different in VFP and MySQL?


Also, Sameer (who is currently writing this portion of the app.) just
looked at the code and wants to know exactly where to place the code.

Randall
--
Ham Radio: AB5NI
I eat spaghetti code out of a bit bucket while sitting at a hash table!
--
Randall Jouett
Amateur/Ham Radio: AB5NI
I eat spaghetti code out of a bit bucket while sitting at a hash table! Someone
asked me if I needed salt, and I said, "I'm not into encryption." :^)
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform