10 Comments to “On VFP and MySql ConnectionStrings”

  1. mpirringer

    Feb 17th, 2010

    Good info. I just made it a habit to handle it on the VFP side with VAL()

    In regards to the ODBC connection. As I Blogged I found – especially over slow connection to get quite a boost on large recordsets by also setting “Use compression”, “Allow Large Record sets”, “Force Forward Only Cursors”

    There is another drastic perf. improvement if you set “Do not cache Forward only cursors” But you will not be able to use shared connections or more than 1 connection at a time then nor run the connection async or you get an “SQL out of Sequence” Error from the Driver. There are some bug reports on those and they hopefully get fixed in the future.

    With compression & fwd only cursurs you are talking getting data in 1/4 the time – with the cache disabled and compression the overall time is reduced to about 1/10. (on a 512k DSL line)

  2. rpupko

    Feb 22nd, 2010

    I had “solved” the problem by casting the result as Decimal so it took me a couple of days to come back here.

    Thanks for the response. Good Info. I have a question, though. You posted in your blog

    Option = 16387


    16384 = Treat BIGINT columns as INT columns

    Is your number a typo? If not, I couldn’t see what other options you had combined to reach that number.

    Again……thanks for your input.

  3. Eric

    Feb 22nd, 2010

    The option is cumulative, like VFP’s MessageBox() parameters. So 16387 = 16384 (Treat BigInt as Int) + 2 (Return matched rows instead of affected rows) + 1 (I have no idea what this is).

    I also don’t know why 16384 works. But it looked like the most likely candidate so I tried it and it fixed my problem so….voila.


  4. Prabir

    May 6th, 2010

    How can I run VFP-MySql programme in a client machine without installing MySql ODBC driver but keeping all MySql files in my programme folder.

  5. Eric Selje

    May 6th, 2010

    Prabir, you pretty much HAVE to install the ODBC drivers to get VFP to talk to MySql, even if it’s all on the local machine. I’ve heard of workarounds, but they’re not easy.

  6. B. Turner

    Dec 21st, 2011


    It seems to me that – since there is no direct equivalent to BigInt in VFP, one option (the one selected) is convert the value to text.

    You can then convert the resulting text back into a numeric value after receiving it (using the VAL(c) function.

    Of course, that adds to processing time (on both ends), but does give you the capability of receiving records with a BigInt of greater than 4.2B (4,294,967,296 unsigned).

  7. balaclava

    Dec 14th, 2012

    Nice post

    question, though.

    Is it possible to
    Options, is it possible to set multiple options in the string?

  8. Eric Selje

    Dec 16th, 2012

    @Balaclava Yes, check out http://dev.mysql.com/doc/refman/5.0/en/connector-odbc-configuration-connection-parameters.html#codbc-dsn-option-flags to see how to translate the options on the GUI into a value that you add to the connection string.

  9. Gil Gzz

    Mar 19th, 2015

    Thats great tip!

    You can resolve issue SELECT SUM(field) and return CHAR?

    Gilberto Gzz

  10. Matt

    Nov 3rd, 2015

    Gilberto Gzz:

    select sum(myNumber)/1

    will cast correctly.

Leave a Reply

Time limit is exhausted. Please reload CAPTCHA.