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);
}
相关文档:
这一次来简单介绍一下我在学习中遇到的一个问题,我先描述一下,然后看操作(声明一点:这一次我没有把这个问题解决掉,希望有人帮我解答)
-------------------------------------------------------------------------
环境:win2003 tomcat6 jsp环境
我使用access2003做数据库,数据源已经配置好,连接数据 ......
原因:IIS没有注册
解决办法:
方法一:
在CMD中进入目录C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727,运行aspnet_regiis
1、aspnet_regiis -ga administrator(administrator为当前用户)
2、aspnet_regiis -i (注册IIS)
3、iisreset /noforce (重启IIS)
操作详细:
C:\Documents and Settings\ ......
具体不多说了,只贴出相关源码~
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数据库开发时遇到一个简单的模糊查询问题,在access2007里面可以查出来,但用C#2.0查询就是查不出来。
后来试出来了,原来 是jet语法的问题:
在Access中,模糊查询用 * 号,如 select * from T_PO where po_NO like '*8*'
但在C#程序里面写的时候要用 % 号,即 select * from T_PO where po_NO like '%8% ......
转自
http://topic.csdn.net/t/20050110/09/3711952.html
access中时间要用#,不是双引号
select * from kc where rq < #2000-01-01# and rq>#2002-01-01#
不要用between,它的效率泰低
使用# 而不是 ......