
Error 458: Variable uses an Automation type not supported in Visual Basic
I'm developing a db appliciation using ADO to connect to MySQL db.
I've been having trouble binding my VB controls to an ADO recordset
object, so instead of using bound controls, I'm manually populating
the controls and checking them on update. Here is an example of how I
update a record:
Private Function UpdateChannel() As Boolean
On Error GoTo Err_UpdateChannel
Dim tb As TextBox
Dim fd As Field
Dim rs As Recordset
Set rs = MyObjects.CurrentChannel
For Each tb In txtChn
Set fd = rs(tb.Tag)
If tb <> fd Then fd = tb
Next
rs.Update
UpdateChannel = True
Exit_UpdateChannel:
Set rs = Nothing
Set fd = Nothing
Set tb = Nothing
Exit Function
Err_UpdateChannel:
Err.Source = "Main.UpdateChannel"
Call ErrHandler
UpdateChannel = False
Resume Exit_UpdateChannel
End Function
This code works perfectly when I update one record type, but raises
the error described in the subject of this message for a different
record type, and I can't figure out why. I've tried using the full
descriptors, i.e. tb.Text and fd.Value, but that doesn't help.
Any help on this would be greatly appreciated!
Brendan