MySQL Forums
Forum List  »  Microsoft Access

mediumtext field - unable to manipulate after retrieval
Posted by: Dave Snape
Date: April 27, 2012 04:28PM

I have just upgraded an access database to MySQL on my test server and have noticed some strange behaviour on any mediumtext fields (converted from memo field in the access db).
In a few instances I replace certain characters after they are retrieved before displaying them on screen. For example "1" goes to "2". The database is not updated - just what is displayed on screen.

However, when I run any command against the database field for example: replace(rs("memofield"),"1","2")
or
len(rs("memofield"))
they fail because the input string is blank.

I can display the field directly with: response.write(rs("memofield")) without any problem so the data is in the field that is retrieved but I just can't 'work' or 'test' the data at all. If I store the memofield to a dummy variable I can then run any command that I want against that dummy field so the data is definitely there!

After tearing my hair out I have narrowed it down to the Open recordset command. When using an Access db I was able to use rs.Open table, connection, adOpenForwardOnly

However, using this with MySQL generates the unexpected behaviour above.

If I change the adOpenForwardOnly to adOpenKeyset then I can test or work with the recordset field however I want.

Before I go through and make this change to the many database retrieval occurances, why is this suddenly a problem with MySQL? Although I've found a way to make it work I don't like doing so without understanding why. I can't find anything documented about this particular issue.

Thanks, Dave

MySQL provider is DRIVER={MySQL ODBC 5.1 Driver}
I am using ASP Classic on IIS

Options: ReplyQuote


Subject
Views
Written By
Posted
mediumtext field - unable to manipulate after retrieval
2768
April 27, 2012 04:28PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.