Ruby Tuesday said:
Hi, I'm having problem moving my Access record to mysql because in
Access I have special characters such as fraction(1/4, 1/2,...) and
other such as backquote(`), etc...
How do I dump it so it replace the fraction with ASCII character
replacements and others but if there are no equivalent, ignore them.
How do you do it programatically in VBA Access XP?
Thanks
You could write a function to translate those characters in whatever
text or memo field is passed to it, using the Replace() function to do
the actual translation. For example:
'----- start of code (AIR CODE) -----
Public Function XlateASCII(FieldText As Variant) As Variant
Dim strText As String
If Len(FieldText & vbNullString) = 0 Then
XlateASCII = FieldText
Else
' Replace the '½' (one-half) character
strText = Replace(FieldText, Chr(189), "-1/2", , ,
vbBinaryCompare )
' Replace the '¼' (one-quarter) character
strText = Replace(strText, Chr(188), "-1/4", , ,
vbBinaryCompare )
' Replace the '¾' (three-quarters) character
strText = Replace(strText, Chr(190), "-3/4", , ,
vbBinaryCompare )
' Replace the '`' (back-quote) character
strText = Replace(strText, Chr(96), "'", , , vbBinaryCompare )
' ... other replacements ...
XlateASCII = strText
End If
End Function
'----- end of code -----
Then, instead of exporting your table, you could export a query in which
you use the XlateASCII function where necessary to translate text and
memo fields.