On 8/10/07, Steve Ellenoff <[EMAIL PROTECTED]> wrote:
> Thanks for the tip about the option string Ted, I hadn't realized you
> could specify it, cool!
Yeah, there's lots of options, and it's worth looking at what your
version of VFP is expecting and how you want the various types of
fields to be translated.
> How could I have avoided hard coding the database name?
Sorry, thought the code was clear: you set lcDatabase to 'test' but
then included the name of the test database directly in your
connection string. I substituted the lcDatabase string.
> So did you try the example and get the proper results?
Define "proper."
Run the first time, I saw, ID I(4,0), T C(0,0), MT C(0,0) and LT
C(0,0), which is what I would expect.
lcOptionString = ";OPTION=" + ALLTRIM(str(MYODBC_NO_COL_WIDTH_OPTIMIZE + ;
MYODBC_RETURN_MATCHING_ROWS + ;
MYODBC_ALLOW_BIG + ;
MYODBC_PAD_CHAR + ;
MYODBC_SQL_DESCRIBE_TABLE + ;
MYODBC_IGNORE_SPACE))
lcCstr = lcCstr + lcOptionString
Adding the OPTION clause above resulted in: ID I(4), T M(4), MT M(4)
and LT C(255), which is an interesting result.
Adding the code:
lcExec2="INSERT INTO "+ lcDatabase + "." + lcTable + ;
" (T, MT, LT) VALUES (?lcText, ?lcMedText,
?lcLongText) "
lcText = "The rain in Spain "
lcMedText = REPLICATE(lcText,20) && 360 chars
lcLongText = REPLICATE(lcMedText, 20) && 7200 chars
IF (loSPT.Execute(lcExec) > 0 ) AND (loSPT.Execute(lcExec2) > 0)
And commenting out the drop command confirmed that the data was being
saved properly.
So, in this case, it appears the ODBC may be failing to properly
interpret the sizes of the fields.
I'm running MySQL ODBC Driver 3.51.12.0 against MySQL 4.1.20.
--
Ted Roche
Ted Roche & Associates, LLC
http://www.tedroche.com
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/profox
OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: http://leafe.com/archives/byMID/profox/[EMAIL PROTECTED]
** All postings, unless explicitly stated otherwise, are the opinions of the
author, and do not constitute legal or medical advice. This statement is added
to the messages for those lawyers who are too stupid to see the obvious.