在网络服务器上,如何设置连接ACCESS数据的连接字符串(c#)
protected OleDbConnection Connection = null;
public static string ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" +Server.MapPath("reporter.mdb"); //这个地方怎么调也是不正确,求助大家,多谢!!!老是说server不存在
public DataBase ()
{
//ConnectionString = ConfigurationSettings.AppSettings["oledsn"] + Server.MapPath(ConfigurationSettings.AppSettings["ole"].Trim());
}
/// <summary>
/// 打开数据库
/// </summary>
protected void Open()
{
if (Connection == null)
{
Connection = new OleDbConnection(ConnectionString);
}
if (Connection.State.Equals(ConnectionState.Closed))
{
Connection.Open();
}
}