C# ´´½¨AccessÊý¾Ý¿â±í
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
Ïà¹ØÎĵµ£º
ÓÐÈýÖÖ°ì·¨
µÚÒ»ÖÖÊÇÓÃaccessµÄJDBCÇý¶¯³ÌÐò£¬µ½http://industry.java.sun.com/products/jdbc/driversÕâ¸öÍøÕ¾ÉϲéÕÒ²¢ÏÂÔÚaccessµÄjdbcÇý¶¯³ÌÐò¡£
µÚ¶þ¸ö°ì·¨ÊÇÄãÓÃÏÂÃæµÄ´úÂëÊÔÊÔ
con = DriverManager.getConnection("jdbc:odbc:Dri ......
using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.OleDb;
/// <summary>
/// DB µ ......
public static class AccessHelper
{
//Êý¾Ý¿âÁ¬½Ó×Ö·û´®
//WebForm
//public static readonly string conn_str = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + HttpContext.Current.Request.PhysicalApplicationPath + System.Configuration.ConfigurationManager ......
DB2ConnectionString
b2str = "Provider=MSDASQL.1;Password=a$sk6G7;Persist Security Info=True;User ID=DBA;Data Source=ConDB2SFXXK"
AccessConnectonString
accessstr = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\DMSJK.mdb;Jet OLEDB:database password=" ......
C#ÖвÙ×÷OracleʱµÄSQLÓï¾ä²ÎÊýµÄÓ÷¨
OracleTransaction myTrans ;
conn.Open();
myTrans =conn.BeginTransaction(IsolationLevel.ReadCommitted) ......