0

I have set my mysql database, tables and columns to be charset utf8mb4. I have set the .asp page to have Response.charset="utf-8"

How do write a select where I check if the rs is including åäö characters?

If I use the below and the variable is without åäö then it works, but if the variable contains a word with åäö, then it doesn´t find it!

thepassword="trött"
sql = "SELECT * FROM table where  password = '"& thepassword &"' ;" 
set rs = conn.Execute (sql)

Any input really appreciated, thanks.

user692942
  • 16,398
  • 7
  • 76
  • 175
Claes Gustavsson
  • 5,509
  • 11
  • 50
  • 86
  • 2
    Using parameterized queries might help you with that as the SQL engine takes care of escaping certain characters and properly preparing the query for you. See: [How do I create a parameterized SQL query? Why Should I?](https://stackoverflow.com/a/542542) – Visual Vincent Nov 10 '18 at 18:27
  • 2
    There are other steps you need to check not just setting `Response.Charset = "UTF-8"`, here is a [similar question](https://stackoverflow.com/a/21914278/692942) that should help. – user692942 Nov 11 '18 at 08:28
  • Thanks, I got it working in the end :-) – Claes Gustavsson Nov 14 '18 at 13:54

0 Answers0