How to parameterize widestrings using TADOCommand parameterized query?
问题 i am trying to use a parameterized query with Delphi TADOCommand: var s: WideString; cmd: TADOCommand; recordsAffected: OleVariant; begin cmd := TADOCommand.Create(nil); cmd.Connection := Connection; cmd.CommandText := 'INSERT INTO Sqm(Filename) VALUES(:filename)'; s := AFilename; cmd.Parameters.ParamByName('filename').Value := s; cmd.Execute(); The resulting data in the database is complete mangled: C?:\U?s?er?s?\i??n?.A?V`A?T?O?P?I?A?\A?p?p?D??t??\L?o???l?\A?v?at??r? S?o?f?t?w?är¨? C?r??t?i