Right
your set up code says “heres a query to run and its going to have SOME parameters”
Then you only specify ONE (since you bind to the 0th item multiple times)
Only when you try to execute does it take all that set up information & finally figure out “your set up says there should be 2 but you only gave me one”
I guess it’s not a big deal since this kind of error would be resolved before a release, but why doesn’t db.Error stay True? The SQLExecute failed. Or, shouldn’t the ErrorCode and ErrorMessage be cleared at least?
The error will be cleared at the next ‘transaction’. If you’re doing Rollback and Commit the error is cleared at that point. Otherwise the next time you do something, like Prepare a statement, sql select, etc, the error is cleared.