易截截图软件、单文件、免安装、纯绿色、仅160KB

ADO数据库连接Access

创建基于对话框的应用程序ADO,向对话框中添加一个列表视图控件,并为其添加变量m_Grid
第一步:ADO对象的导入
在StdAfx.h头文件中:
// stdafx.h : include file for standard system include files,
//  or project specific include files that are used frequently, bu
//      are changed infrequently
//
#if !defined(AFX_STDAFX_H__D5ADC0DF_B5B2_4973_A035_4F2F1585998F__INCLUDED_)
#define AFX_STDAFX_H__D5ADC0DF_B5B2_4973_A035_4F2F1585998F__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#define VC_EXTRALEAN  // Exclude rarely-used stuff from Windows headers
#include <afxwin.h>         // MFC core and standard components
#include <afxext.h>         // MFC extensions
#include <afxdisp.h>        // MFC Automation classes
#include <afxdtctl.h>  // MFC support for Internet Explorer 4 Common Controls
#ifndef _AFX_NO_AFXCMN_SUPPORT
#include <afxcmn.h>   // MFC support for Windows Common Controls
#endif // _AFX_NO_AFXCMN_SUPPORT
//ADO对象的导入代码
#import"C:\Program Files\Common Files\System\ado\msado15.dll"
no_namespace rename("EOF","adoEOF")rename("BOF","adoBOF")
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_STDAFX_H__D5ADC0DF_B5B2_4973_A035_4F2F1585998F__INCLUDED_)
第二步:初始化COM环境
BOOL CADOApp::InitInstance()
{
 AfxEnableControlContainer();
 AfxOleInit();//或者::CoInitialize(NULL);
··················
··················
 return FALSE;
}
第三步:连接数据库


相关文档:

Access Insert Into 语法错误 集锦(不断更新中...)

最近在做Access的一个项目,总是莫名其妙的提示:“Insert Into 语法错误”,这样的信息总给人带来很多麻烦,有时候为了这样一个错误要找好久才能解决问题,"Insert Into 语法错误"这个提示本身包含的信息量很少,在跟踪堆栈中有找不到更详细的信息,为了避免大家在开发的过程中遇到同样的错误和困扰。通过查找和 ......

access事务插入多条记录

protected void Button1_Click(object sender, EventArgs e)
    {
        /*=============测试通过===============*/
       
OleDbConnection con = new
OleDbConnection("Provider=Microsoft.Jet.OleDb.4.0;Data
Sou ......

access关联删除的问题

问题:
 有二个表
A表:
id Comment yuyan lanmuid
1 aaaa  chinese 1
2 bbbb english 1
3 cccc chinese 2
4 ddddd  english 2
B表:
id lanmu
1 公司简介
2 联系方式
3 经营范围
在删除B表的一行数据时会把A表关联ID的数据也删除,请问有什么好方法?我不想操作2次删除的语句.
解决方 ......

access 的多个left join 要加括号

 string sql = "select  a.orderId,a.UserName,b.CodeValue as Delivery ,a.DeliveryAddress,a.PhoneNum,c.CodeValue as Payment,d.CodeValue as OrderStatus,d.CodeValue as OrderStatusID,a.OrderTime,a.Merchant from  (( m_Order a ";
            sql += " left j ......

c#操作access数据库

 using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Data.OleDb;
namespace AddressList
{
public partial class FrmAccessUse : Form
{
public Fr ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号