ADO and Unicode


  • The session.codepage must be set to 65501. This session codepage is support only in Internet Information Server 5.0 (IIS 5.0).
  • Retrieval of unicode values must be done through a stored procedure, get_unicode.
  • Optional: You can specify a font family. The font family must support Unicode code points. Here's one font that will work: style="font-family: arial unicode ms"

   Dim cnn, rstUnicode,strSQL,cmd
   Dim sCriteria
   Dim sUnicode_Number
   Dim sCode_Point
   Dim sUnicode_Code_Points
   Dim sOutput

   Response.Buffer = True

   Set cnn = Server.CreateObject("ADODB.Connection")
   cnn.Open "your_dsn", "user_name", "password"

   set rstUnicode=nothing

   if len(sUnicode_Number)>0 or len(sCode_Point)>0 then

       set cmd=Server.CreateObject("ADODB.Command")
       'Unicode Value
       cmd.Parameters.append cmd.CreateParameter("@p_unicode_number",adVarChar,adParamInput,50,sUnicode_Number)
       'Unicode Code Point
       cmd.Parameters.append cmd.CreateParameter("@p_code_point",adVarWChar,adParamInput,200,sCode_Point)
       cmd.Parameters.append cmd.CreateParameter("@p_output_code_point",adVarWChar,adParamOutput,200,"")


       if sUnicode_Code_Points="" then
           Response.Write "No Records Found"
       end if
   end if

       <META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=utf-8">
       Unicode Submission Test - Database


   <TR BGCOLOR="lemonchiffon"><TH>Code</TH><TH>Display</TH><TH>Notes</TH></TR>
       <TD>You submitted <B><%=Len(sUnicode_Code_Points)%></B> characters.</TD>
       <TD>Length of code point submitted</TD>
       strSQL="select length(code_point) field_length from unicode_test where unicode='"&sUnicode_Number&"'"
       set rstUnicode= cnn.Execute(strSQL)
       if not rstUnicode.eof then
           <TD>Unicode Code Point Length in Database</TD>

       end if
       <TD>Unicode Code Points - Rendered by the Browser</TD>

You might also like...


About the author

David Nishimoto United States

NishiSoft provides Part I of the Information Technology Project collaboration. Sign up and list your IT project tasks, assign task too friends, and get percent complete task.

Part will ...

Interested in writing for us? Find out more.


Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“The greatest performance improvement of all is when a system goes from not-working to working.” - John Ousterhout