I don't use ODBC, but I can't see the library itself doing this.
Are you using a varchar type field for your database, or is it a char type field? That strAccountID for example appears to have 20 chars in total, which would be consistent with a char(20) datatype. MySQL for example would right pad the string to the size required to fit in the char field. Instead we'd use varchar to allow up to but not pad the size of the field in question. Not sure what db you are using though, so I can't really help on that.
PHP wise you can simply rtrim() the data to remove the excess padding.
header('HTTP/1.1 420 Enhance Your Calm');