有关用dreamweaver连接access数据库中文显示乱码的问题

beikerray119 2004-12-05 01:25:48
高手帮忙看看,急啊!

我用的是dreamweaverMX2004
数据库是access2003
mdac是2.7版

现在用dreamweaver连接数据库以后,生成的网页里面汉字显示乱码,但是在access里面看是正确的,有谁知道是怎么回事,帮帮忙啊。

下面是我的源代码:

<%@ Page Language="VB" ContentType="text/html" %>
<%@ Register TagPrefix="MM" Namespace="DreamweaverCtrls" Assembly="DreamweaverCtrls,version=1.0.0.0,publicKeyToken=836f606ede05d46a,culture=neutral" %>
<MM:DataSet
id="dsGBook"
runat="Server"
IsStoredProcedure="false"
ConnectionString='<%# System.Configuration.ConfigurationSettings.AppSettings("MM_CONNECTION_STRING_cnGBook") %>'
DatabaseType='<%# System.Configuration.ConfigurationSettings.AppSettings("MM_CONNECTION_DATABASETYPE_cnGBook") %>'
CommandText='<%# "SELECT * FROM tblGBook ORDER BY datPostDate DESC" %>'
Debug="true" PageSize="10"
></MM:DataSet>
<MM:PageBind runat="server" PostBackBind="true" />
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>GBook</title>
</head>

<body>
<form runat="server">
<asp:DataGrid id="DataGrid1"
runat="server"
AllowSorting="False"
AutoGenerateColumns="false"
CellPadding="3"
CellSpacing="0"
ShowFooter="false"
ShowHeader="true"
DataSource="<%# dsGBook.DefaultView %>"
PagerStyle-Mode="NextPrev"
AllowPaging="true"
AllowCustomPaging="true"
PageSize="<%# dsGBook.PageSize %>"
VirtualItemCount="<%# dsGBook.RecordCount %>"
OnPageIndexChanged="dsGBook.OnDataGridPageIndexChanged"
>
<HeaderStyle HorizontalAlign="center" BackColor="#E8EBFD" ForeColor="#3D3DB6" Font-Name="Verdana, Arial, Helvetica, sans-serif" Font-Bold="true" Font-Size="smaller" />
<ItemStyle BackColor="#F2F2F2" Font-Name="Verdana, Arial, Helvetica, sans-serif" Font-Size="smaller" />
<AlternatingItemStyle BackColor="#E5E5E5" Font-Name="Verdana, Arial, Helvetica, sans-serif" Font-Size="smaller" />
<FooterStyle HorizontalAlign="center" BackColor="#E8EBFD" ForeColor="#3D3DB6" Font-Name="Verdana, Arial, Helvetica, sans-serif" Font-Bold="true" Font-Size="smaller" />
<PagerStyle BackColor="white" Font-Name="Verdana, Arial, Helvetica, sans-serif" Font-Size="smaller" />
<Columns>
<asp:BoundColumn DataField="intPostID"
HeaderText="intPostID"
ReadOnly="true"
Visible="True"/>
<asp:BoundColumn DataField="strName"
HeaderText="strName"
ReadOnly="true"
Visible="True"/>
<asp:BoundColumn DataField="bolSex"
HeaderText="bolSex"
ReadOnly="true"
Visible="True"/>
<asp:BoundColumn DataField="strURL"
HeaderText="strURL"
ReadOnly="true"
Visible="True"/>
<asp:BoundColumn DataField="strEmail"
HeaderText="strEmail"
ReadOnly="true"
Visible="True"/>
<asp:BoundColumn DataField="strICQ"
HeaderText="strICQ"
ReadOnly="true"
Visible="True"/>
<asp:BoundColumn DataField="strSubject"
HeaderText="strSubject"
ReadOnly="true"
Visible="True"/>
<asp:BoundColumn DataField="strContent"
HeaderText="strContent"
ReadOnly="true"
Visible="True"/>
<asp:BoundColumn DataField="datPostDate"
HeaderText="datPostDate"
ReadOnly="true"
Visible="True"/>
</Columns>
</asp:DataGrid>
</form>
</body>
</html>
...全文
200 点赞 收藏 2
写回复
2 条回复
切换为时间正序
当前发帖距今超过3年,不再开放新的回复
发表回复
beikerray119 2004-12-05
还是不行啊,没有一点影响啊。
回复
hongyanyufei 2004-12-05
在<%@ Page Language="VB" ContentType="text/html" %>这句里加上charset=gb2312看看
回复
相关推荐
发帖
ASP
创建于2007-09-28

2.8w+

社区成员

ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
申请成为版主
帖子事件
创建了帖子
2004-12-05 01:25
社区公告
暂无公告