F
Frank
Hi,
I guess it is a common problem when read some DBCS value from Excel
spreadsheet but got question marks.
Following are my code
-----------------------------------------------------------------------------------
<%
Session.CodePage=65001
response.charset="UTF-8"
%>
<HTML>
<HEAD>
<META http-equiv="Content-Type" content="text/html; charset=utf-8">
</HEAD>
<BODY>
<%
'Create a connection
Set oConn = Server.CreateObject("ADODB.Connection")
strConn = "Driver={Microsoft Excel Driver (*.xls)}; " &_
"DBQ=<someXLS file>;" 'How to can set codepage or characterset here?
oConn.Open strConn
strCmd = "SELECT * from `<some Name defined in Excel>'"
'Create a recordset
Set oRS = Server.CreateObject("ADODB.Recordset")
oRS.Open strCmd, oConn
'Output conects of Excel
while not oRS.EOF
for each item in oRs.Fields
response.write item.Name & "==>" & item.value & "<br>"
Next
ORs.moveNext
Wend
set ORs= nothing
set oConn = nothing
%>
</BODY>
</HTML
-------------------------------------------------------------------------------------
For the cloumn that include some Asian languages like Chinese, Japanese and
Korean, will display question marks ??? at this page.
Is it any way we can set codepage or characterset in the connectionstring?
Regadrs,
Frank
I guess it is a common problem when read some DBCS value from Excel
spreadsheet but got question marks.
Following are my code
-----------------------------------------------------------------------------------
<%
Session.CodePage=65001
response.charset="UTF-8"
%>
<HTML>
<HEAD>
<META http-equiv="Content-Type" content="text/html; charset=utf-8">
</HEAD>
<BODY>
<%
'Create a connection
Set oConn = Server.CreateObject("ADODB.Connection")
strConn = "Driver={Microsoft Excel Driver (*.xls)}; " &_
"DBQ=<someXLS file>;" 'How to can set codepage or characterset here?
oConn.Open strConn
strCmd = "SELECT * from `<some Name defined in Excel>'"
'Create a recordset
Set oRS = Server.CreateObject("ADODB.Recordset")
oRS.Open strCmd, oConn
'Output conects of Excel
while not oRS.EOF
for each item in oRs.Fields
response.write item.Name & "==>" & item.value & "<br>"
Next
ORs.moveNext
Wend
set ORs= nothing
set oConn = nothing
%>
</BODY>
</HTML
-------------------------------------------------------------------------------------
For the cloumn that include some Asian languages like Chinese, Japanese and
Korean, will display question marks ??? at this page.
Is it any way we can set codepage or characterset in the connectionstring?
Regadrs,
Frank