Access
来源:互联网 发布:企业大数据应用平台 编辑:程序博客网 时间:2024/04/29 18:32
using System;
using System.IO;
using System.Windows.Forms;
using Access = Microsoft.Office.Interop.Access;
// 添加引用->.NET-> dao,Microsoft.Office.Interop.Access
namespace WinFormAccess
{
public partial class FormAccess : Form
{
public FormAccess()
{
InitializeComponent();
}
protected override void OnLoad(EventArgs e)
{
base.OnLoad(e);
try
{
string dbPath = Path.Combine(Application.StartupPath, "Images.mdb");
if (File.Exists(dbPath))
File.Delete(dbPath);
Access.Application newAccess = new Access.Application();
newAccess.NewCurrentDatabase(dbPath); // 创建数据库。
dao.Database db = newAccess.CurrentDb();
db.Execute("create table [Images] (Name string primary key, Bytes LongBinary)", Type.Missing);
db.NewPassword("", "jinzhexian"); // 设置密码。
db.Close();
newAccess.Quit(Access.AcQuitOption.acQuitSaveNone);
newAccess = null;
GC.Collect();
System.Diagnostics.Process.Start(dbPath);
}
catch (Exception se)
{
MessageBox.Show(se.Message);
}
}
}
}
- access
- ACCESS
- Access
- access
- access
- access
- Access
- access()
- access
- Access
- Access
- Access
- access
- access
- access
- access
- access
- access()
- System.Net.Mail 发送邮件 SMTP协议
- How to Teach Yourself Programming
- JNative 调用动态链接库
- Reading Notes: Beginning.DB2.From.Novice.to.Professional.Aug.2008
- Java算法(一)
- Access
- Win 7下运行Foxmail6.5出现“Access violation”错误
- myeclipse修改发布到tomcat目录下的项目名称
- 如何在一个文件中创建两个类?
- Microsoft Visual Studio 2008官方下载
- poj 1679 The Unique MST
- (转)学习c/c++的50个好网站
- 敏捷开发中编写高质量Java代码
- 删除整篇Word文档中的图文框