VC修改Access密码
void ModifyDBCode()
{
CString strPath;
::GetModuleFileName(GetModuleHandle(NULL),strPath.GetBuffer(256),256);
strPath.ReleaseBuffer();
int flag=strPath.ReverseFind('\\');
int size=strPath.GetLength();
strPath.Delete(flag,size-flag);
strPath= strPath+ _T("\\test.mdb"); //数据库名称
CString strConn=_T("Provider=Microsoft.ACE.OLEDB.12.0;User ID=Admin;Data Source=");
CString buf=strPath;
ASSERT(buf != _T(""));
strConn+=buf;
strConn+=_T(";Jet OLEDB:Database Password = ");
strConn+= g_strPassword;
strConn+=_T(";Mode=Share Deny Read|Share Deny Write"); // du zhan fang shi da kai
CADODatabase pAdoDb;
pAdoDb.SetConnectionString(strConn);
if(!pAdoDb.Open()) return;
CString strExe = _T("ALTER DATABASE PASSWORD [");
strExe += m_strNewCode;
strExe += _T("] [");
strExe += g_strPassword;
strExe += _T("]");
pAdoDb.Execute(strExe);
}
相关文档:
具体不多说了,只贴出相关源码~
using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using System.Data.OleDb;
using System.Web;
/**//// <summary>
/// 名称:access下的分页方案(仿sql存储过程)
/// 作者:cncxz(虫虫)
/// blog:http://cncxz.cnblogs.com
/// ......
Access、SQLServer、Oracle常见SQL语句应用区别
关劲松 PMP
如果要兼容Access、SQL Server、Oracle三个数据库版本;我们在编写SQL语句的过程中,尽量使用一些通用的语句,但还是有些方面有些区别避免不了,现简单总结一下。
以下A代表Access,S代表SQL Server,O代表Oracle
1、取当前系统时间
A:Select Now()
S:Selec ......
C#连接连接Access
首先看一个例子代码片断:
程序代码:
--------------------------------------------------------------------------------
using System.Data;
using System.Data.OleDb;
......
string strConnection="Provider=Microsoft.Jet.OleDb.4.0;";
strConnection+=@"Data Source=C:\BegASPNET\Northwin ......
转自
http://topic.csdn.net/t/20050110/09/3711952.html
access中时间要用#,不是双引号
select * from kc where rq < #2000-01-01# and rq>#2002-01-01#
不要用between,它的效率泰低
使用# 而不是 ......