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
Ïà¹ØÎĵµ£º
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 µ ......
Ö±½Óͨ¹ýADO²Ù×÷AccessÊý¾Ý¿â
×÷Õß/Ðì¾°ÖÜ
ÏÂÔØÔ´´úÂë
ÎÒÔÚ¡¶VC֪ʶ¿âÔÚÏßÔÓÖ¾¡·µÚÊ®ËÄÆÚºÍµÚÊ®ÎåÆÚÉÏÔø·¢±íÁËÁ½ÆªÎÄÕ——“Ö±½Óͨ¹ýODBC¶Á¡¢Ð´Excel±í¸ñÎļþ”ºÍ“Ö±½Óͨ¹ýDAO¶Á¡¢Ð´AccessÎļþ”£¬ÏÈºó¸ø´ó¼Ò½éÉÜÁËODBCºÍDAOÁ½ÖÖÊý¾Ý¿â·ÃÎʼ¼ÊõµÄ»ù±¾Ê¹Ó÷½·¨£¬Õâ´Î ......
ÔÚ×öasp.netµÄWeb¿ª·¢µÄʱºò£¬ÎÒÃǾ³£»áÓöµ½Ò»´ÎÐÔÉÏ´«¶à¸öÎļþµÄÐèÇó¡£Í¨³£ÎÒÃǵĽâ¾ö·½·¨Êǹ̶¨·Å¶à¸öÉÏ´«Îļþ¿ò£¬ÕâÑùµÄ½â¾ö°ì·¨ÏÔÈ»ÊDz»ºÏÀíµÄ£¬ÒòΪһ´ÎÉÏ´«¶à¸ö£¬¾ÍÒâζ×ÅÊýÁ¿²»È·¶¨¡£Òò´ËÎÒÃǾÍÒªÈÃÕâЩÎļþÉÏ´«¿ò¶¯Ì¬Ìí¼Ó£¬ÏÂÃæÎÒÒÔÎÒ×öµÄÒ»¸öͼ¿â¹ÜÀíÖеÄÉÏ´«Í¼Æ¬µÄ¹¦ÄÜΪÀý
ÏÈ¿´Ð§¹û£º
´ò¿ªµÄ³õʼ½çÃæ£º
ĬÈÏ ......
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 ......
ÔÚWin7ϰ²×°ÍêFoxmail6.5£¬Í˳ö³ÌÐò²¢ÖØÐÂÆô¶¯Foxmailºó³öÏÖÈçÏ´íÎó£º
Access violation at address 007CC4B1 in module 'Foxmail.exe'. Read of address 00000014.
µ¼ÖÂFoxmail²»ÄÜÆô¶¯£¬µã»÷È·¶¨ºóÈԻ᲻¶Ï³öÏÖÀàËÆ´íÎóÌáʾ¡£
Õâ¿ÉÄÜÊÇFoxmailÔÚWin7 ......