急求:ERROR [IM002] [Microsoft][ODBC 驱动程序管理器] 未发现数据源名称并且未指定默认驱动程序
&&&&&&&下面的是我在visual studio 2005 中编写上,但运行这后,就出出上面的问题“ERROR [IM002] [Microsoft][ODBC 驱动程序管理器] 未发现数据源名称并且未指定默认驱动程序 ”就在“AconnStr.Open();”打住了,请各位高手帮帮忙。&&&&&&&&&&&谢谢!谢谢!数据库我用的是access 2000的。
<%@ Page Language= "C# " ContentType= "txet/html "AutoEventWireup= "true " CodeFile= "OleDbConnection.aspx.cs " Inherits= "_Default " %>
<%@ Import Namespace = "System.Data " %>
<%@ Import Namespace = "System.Data.Odbc " %>
<script language= "c# " runat = "server ">
public OdbcConnection AconnStr;
void Page_Load(Object sender,EventArgs e){
string Afile = Server.MapPath( "App_Data/User.mdb ");
OdbcConnection AconnStr= new OdbcConnection ( "Driver={Microsoft Access Driver(*.mdb)};Dbq= "+Afile+ "; ");
Response.Write(AconnStr);
OdbcCommand Acmd= new OdbcCommand( "select * from UserName order by ID ", AconnStr);
Response.Write(Acmd);
OdbcDataReader odr = null;
AconnStr.Open();
try
{
odr = Acmd.ExecuteReader();
}
catch (Exception ex)
{
if (ex != null) Response.Write(ex.ToString());
}
if (odr != null)
{
string TotalInfo = " ";
while (odr.Read())
{
TotalInfo += odr[ "ID "].ToString() + " " + odr[ "UserName "].ToString() + " <br/> ";
&