日期:2014-05-17 浏览次数:20805 次
public class AccessDB
{
public enum HandleFlag { Insert, Delete, Update };
//private String connectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" +
// " Data Source= " + AppDomain.CurrentDomain.BaseDirectory +
// "\\Resources\\PrivateFinance.accdb";
private OleDbConnection connection = null;
private OleDbCommand command = null;
int num = 0;
public AccessDB()
{ }
//增加access数据库的路径的构造函数
private OleDbConnection BuildAccessDB(String Uri)
{
#region 打开连接,操纵数据库
String connectionString = "Provider=Microsoft.ACE.OLEDB.12.0;" +
" Data Source= " + Uri + "Resources\\PrivateFinance.accdb";
connection = new OleDbConnection(connectionString);
try
{
connection.Open();
}
catch (Exception e)
{