- The session.codepage must be set to 65501. This session codepage is support only in Internet Information Server 5.0 (IIS 5.0).
- Two oracle stored procedures used to add and update the unicode data need to be created.
- An Active Data Object (ADO) Command Object must be instantiated. ADO command object input parameters must be used to send the unicode data. Binding between a command object parameter and UTF8 string is accomplished as follows: The type parameter must be adVarWChar (unicode string null terminated) .
- NLS_LANG must be change to AMERICAN_AMERICA.UTF8 in the Windows registry.
- The 8.1.7.2 Oracle ODBC Driver must be download from Oracle and installed on the Server Machine. You must signup as a member of the Oracle Technology Network (OTN) to download the ODBC driver.
- Setup a ODBC Data Source Name (DSN) referencing the 8.1.7.2 Oracle driver.
<%@Language=VBScript%>
<%
option explicit
>
<--#INCLUDE FILE="adovbs.inc"-->
<%
Dim cnn,rs,strSQL,cmd
Dim sCode_Point
Dim sUnicode_Number
session.CodePage=65001 'UTF-8 Codepage supported only in iis5.0
Set cnn = Server.CreateObject("ADODB.Connection")
cnn.Open "your_dsn", "user_name", "password"
sCode_Point=request("code_point")
sUnicode_Number=request("unicode_number")
if sUnicode<>"" and sCode_Point<>"" then
set rs=nothing
strSQL ="select unicode from unicode_test where unicode_number='" & sUnicode_Number
& "'"
set rs=cnn.Execute(strSQL)
if rs.EOF THEN
set cmd=Server.CreateObject("ADODB.Command")
cmd.ActiveConnection=cnn
cmd.CommandText="add_unicode"
cmd.CommandType=adCmdStoredProc
cmd.Parameters.append cmd.CreateParameter("@p_code_point",adVarWChar,adParamInput,200,sCode_Point)
cmd.Parameters.append cmd.CreateParameter("@p_unicode_number",adVarChar,adParamInput,50,sUnicode_Number)
cmd.execute
else
set cmd=Server.CreateObject("ADODB.Command")
cmd.ActiveConnection=cnn
cmd.CommandText="update_unicode"
cmd.CommandType=adCmdStoredProc
cmd.Parameters.append cmd.CreateParameter("@p_code_point",adVarWChar,adParamInput,200,sCode_Point)
cmd.Parameters.append cmd.CreateParameter("@p_unicode_number",adVarChar,adParamInput,50,sUnicode_Number)
cmd.Execute
end if
Response.Redirect("database_results.asp&unicode_number=" & sUnicode_Number
&"&code_point="&sCode_Point)
else
Response.Write "
Both the unicode characters and code are required"
end if
%>
Comments