Re: Bitten by a strange bug...
Tom - I'll address what I can I had the same problem with fields being truncated on direct connections (the problem does not manifest on ODBC table attaches in Access). IIRC, the way to solve this problem is to make sure the optimize columns widths (option 1) in the ODBC properties. Hope that helps (at least a little). j- k- On Wednesday 28 August 2002 15:37, Tom Emerson wrote: But enough of the background, here is the problem: developing a visual-basic (6) application using myodbc connected to a mysql database on the network. Adding records works well the first time, but after the database has closed (i.e., the next time I run the program), I run into problems. I've tracked it down to what VB believes is the maximum field size for a given field, and it appears to be limited to whatever the longest value is in the particular field -- when a table is new (empty), there are no entries, so VB thinks the fields are -1 in length (technically, unlimited), and the program works fine. The next time the program runs, the fields definedlength property is set to whatever the longest value happens to be in the table (hence the ugly workaround is to insert a bogus entry with spaces or some filler character padded out to the maximum length -- this is fine for master [key] tables, but for detail entries it might become problematic.) I've even tried the pad char fields to maximum option via the ODBC driver window in the control panel, but that doesn't seem to have any effect. -- Joshua Kugler, Information Services Director Associated Students of the University of Alaska Fairbanks [EMAIL PROTECTED], 907-474-7601 - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Re: Bitten by a strange bug...
I had this problem to but was never able to find what was causing it. The way I got around it was by doing execute statements like: connection.execute(INSERT INTO .) That way I avoided VB handling the updates and it worked. But since Josh pointed this little problems solution out I might give that a try. -Nick Tom - I'll address what I can I had the same problem with fields being truncated on direct connections (the problem does not manifest on ODBC table attaches in Access). IIRC, the way to solve this problem is to make sure the optimize columns widths (option 1) in the ODBC properties. Hope that helps (at least a little). j- k- On Wednesday 28 August 2002 15:37, Tom Emerson wrote: But enough of the background, here is the problem: developing a visual-basic (6) application using myodbc connected to a mysql database on the network. Adding records works well the first time, but after the database has closed (i.e., the next time I run the program), I run into problems. I've tracked it down to what VB believes is the maximum field size for a given field, and it appears to be limited to whatever the longest value is in the particular field -- when a table is new (empty), there are no entries, so VB thinks the fields are -1 in length (technically, unlimited), and the program works fine. The next time the program runs, the fields definedlength property is set to whatever the longest value happens to be in the table (hence the ugly workaround is to insert a bogus entry with spaces or some filler character padded out to the maximum length -- this is fine for master [key] tables, but for detail entries it might become problematic.) I've even tried the pad char fields to maximum option via the ODBC driver window in the control panel, but that doesn't seem to have any effect. -- Joshua Kugler, Information Services Director Associated Students of the University of Alaska Fairbanks [EMAIL PROTECTED], 907-474-7601 - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Bitten by a strange bug...
I've been pounding my head against a wall for the last couple of days trying to make a simple program work (to then use as the basis for future programs, etc. -- in other words, I'm still just learning this stuff) I'd really like to point the finger at Microsoft visual basic, but I've been around long enough to know that there are too many fingers in this pie to write it off that easily. So, I'm not sure if I've encountered a real bug, or just a known issue for which there may be a workaround -- what I've tried so far hasn't done what I need, and the workaround I *know* will work is a kludge at best: ugly, but functional. But enough of the background, here is the problem: developing a visual-basic (6) application using myodbc connected to a mysql database on the network. Adding records works well the first time, but after the database has closed (i.e., the next time I run the program), I run into problems. I've tracked it down to what VB believes is the maximum field size for a given field, and it appears to be limited to whatever the longest value is in the particular field -- when a table is new (empty), there are no entries, so VB thinks the fields are -1 in length (technically, unlimited), and the program works fine. The next time the program runs, the fields definedlength property is set to whatever the longest value happens to be in the table (hence the ugly workaround is to insert a bogus entry with spaces or some filler character padded out to the maximum length -- this is fine for master [key] tables, but for detail entries it might become problematic.) I've even tried the pad char fields to maximum option via the ODBC driver window in the control panel, but that doesn't seem to have any effect. The version(s) of the various programs is or should be the latest -- I just downloaded and installed the vis-studio service pack 5 MDAC 2.7 today; the myodbc driver is the stable one from the myodbc site [downloaded a couple of days ago]; and mysql itself was installed initially from the SuSE 8.0 distribution updated accordingly, so it is no more than a month or two old at best. So, is this a real bug [for which I should develop a proper repeatable environment/program], a known issue [with hopefully a simple solution], or am I simply doing it wrong -- within VB there is a query-like program which can retrieve update arbitrary tables and it CAN enter a new field with longer-than-previous values [and I'm reasonably certain this is a vb/vc++ application], so I know somehow/somewhere this is possible. Another possible part of the wrinkle: I'm developing this using what VB calls a dataenvironment, and that is the component that seems to have the problem. Another wizard within VB is a data view window, and that one seems to be able to determine the proper field sizes, but when a table is drag-n-dropped from the data view window to the dataenvironment builder (component), it loses that bit of information about each field. Tom Emerson p.s. although I've posted this to the main mysql list, I have a sneaking suspicion this is more appropriate for the myodbc list -- if so, please point me that way and I'll take the discussion there :) - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php