Search code examples
mysqlms-accessalterinsert-into

MySql resizing varchar issue braking insert


I have an issue where a MySql varchar was Alterred from 45 to 255 yesterday, however today newly inserted data is still limited to 45 characters, any ideas what would cause this or how routinely I could modify the behaviour.

The field manually, through Workbench, accepts and inserts longer data. The data is being added using INSERT INTO tblx( i ) Select i from tbly

Where tblx is an InnoDB(5.0.18) and tbly is a an MS Access(2010) table, and the field in question a memo.

The select part in full in case the joins have a bearing is:

SELECT F1, F2, F3, F4, F5, F6, F7, F8, F9, First(F10), 'in', todaysDate() FROM CSAT_Interactions LEFT JOIN tblContactList_temp ON [CSAT_Interactions].F1 = tblContactList_temp.InteractionNumber AND CDate([CSAT_Interactions].F2) = CDate(tblContactList_temp.StartDate) GROUP BY F1, F2, F3, F4, F5, F6, F7, F8, F9, 'in', todaysDate(), DateAdded HAVING F1 Not Like 'interaction id'

I can post-fix the data, but I need to alter the db behaviour or modify the statement in the VBA that is inserting the data as this is a daily routine. At the moment the sql statement does not seem to have anything strange about it and it is using "CurrentDb.Execute sql" This is long established code, unchanged, just the column size has been increased.

Thanks.


Solution

  • ... a MySql varchar was altered from 45 to 255 yesterday, however today newly inserted data is still limited to 45 characters

    If tblx in Access is a link to the MySQL table, tell Access to refresh the link so that it recognizes the change to the source table's design ...

    CurrentDb.TableDefs("tblx").RefreshLink
    

    When you create a link, Access caches metadata about the source table's structure. But that metadata is not updated automatically in response to design changes in the source table. RefreshLink signals Access to update that information.