Codepage problem in asp pages, mssql database

can't seem to get diacritics when pulling out data from sql database

conn string is:
i_dbConnection = "Driver={SQL Native Client};\SQLEXPRESS,xxxx; Database=db; UID=; Pwd="

asp page:
<meta http-equiv="Content-Type" content="text/html; charset=windows-1250">

when i query database from sql management studio everything shows up fine.
Who is Participating?
fokuszgConnect With a Mentor Author Commented:
or not
problem was... i was using stored proc to pull the data out, in a mannor that they fill the temp table and when creating temp table data type was varchar. i just used nvarchar and everything worked out fine.
What diacritics specifically?  ASP script (VBScript) will have trouble with quotes and apostrophes because they are used by the script itself.
What I usually do is make sure that the escape character is stored in the database as well.  For example, in VBScript to escape, you use the same character twice so if you used the name O'Hanlan, make sure it is stored in the database as O''Hanlan using vbscript string 'replace()' function.  Or you could replace the character with something that doesn't cause a problem (like a pipe | ) when storing the data and replace it back to what it is supposed to be when you pull the data back out of the database.  Or you can use replace to store the ASCII value of the character [tempString = replace(tempString,"'", chr(39))].  The script won't see this as an apostrophe but when it is displayed in HTML, the browser will see it as an apostrophe.
fokuszgAuthor Commented:
croatian diacritic characters, not special characters.
Cloud Class® Course: Microsoft Windows 7 Basic

This introductory course to Windows 7 environment will teach you about working with the Windows operating system. You will learn about basic functions including start menu; the desktop; managing files, folders, and libraries.

rhodesbConnect With a Mentor Commented:
Sorry, I don't have any real experience dealing with non-English or non-standard characters.  I would try putting one of the characters into a static string to see if asp will deal with it.  Try to narrow down whether your problem is the asp script itself, your recordset object or the database (it sounds like the database is not the problem because your queries work from the management studio).  If it is a problem with a limitation in the asp script, then I'm not sure what the solution would be but if it is a problem with the recordset object, then my solution of using substitute characters and then changing them back should work.  Sorry I couldn't be of more help.
fokuszgAuthor Commented:
its neither
i have a different website on my own server and it works perfectly with the same asp code
only difference is this is a hosted server and i donno what they could have done differently when setting up mssql
Ok.  I'm not sure what they would have set up differently either.  Perhaps a language pack that is installed on your server but not the hosted one?  Sorry I couldn't be of more help.
fokuszgAuthor Commented:
Thx for trying anyway
fokuszgAuthor Commented:
i identified the source of the problem.
the table i created manually on sqlsrver works fine, but the tables that are transfered via webservice do not display characters correctly. i do not understand why, since they both look just fine when paging records for management studio
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.