I pull a large recordset from a MySQL server and I assign a bunch of variables in an Excel VBA routine based on the field position, e.g.:
x = MyRecordset.Fields(0).Value
y = MyRecordset.Fields(1).Value
' etc...
The only time this throws an error is when one of the values is NULL, because VBA doesn't allow a string to be NULL. I have a question for both sides, VBA and the MySQL side in case the VBA side falls down:
VBA: I'm currently using On Error Resume Next
to skip the NULL error - is there a better / more official way to achieve this? Is this error skipping slowing my code down?
MySQL: Is there a way to prevent "NULL" being sent, e.g. to quickly replace instances of NULL with an empty string in my SELECT
statement?