ADO ACCESS 获取表名
BOOL GetAllTables(LPCTSTR databasefile,CStringArray & dbtables)
{
//#import "msado15.dll" no_namespace rename("EOF", "adoEOF") //拷贝 msado15.dll 到工程目录
_ConnectionPtr m_pConnection;
_RecordsetPtr m_pRecordset;
HRESULT hr;
try
{
CoInitialize(NULL);
hr = m_pConnection.CreateInstance(__uuidof(Connection));
hr =m_pRecordset.CreateInstance(__uuidof(Recordset));
if(SUCCEEDED(hr))
{
CString strconnection;
strconnection.Format("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=%s",databasefile);
hr = m_pConnection->Open((_bstr_t)strconnection,"","",adModeUnknown);
m_pRecordset = m_pConnection->OpenSchema(adSchemaTables); &nb
相关文档:
用Cdbl()试试
CDbl(str) --> 双精度
CInt(str) --> 整型
CLng(str) --> 长整型
CSng(str) --> 单精度
CDate(str) --> 日期型 ......
这段时间在做CMS(客户管理系统,不是内容管理)的访问管理功能,要求实现对服务提供设备,客户端,计费,权限认证等信息的存储统计,远程管理。要求系统发布要方便,远程管理软件要跑在WIN平台。考虑到系统规模,客户要求,最后选择了WIN+ACCESS的方案,而最近又发现一个免费的SQLITE,而且可能在以后的手持设备上用,花点 ......
<connectionStrings>
<add name="qxConnectionString" connectionString="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=Web/App_Data/db2.mdb;" providerName="System.Data.OleDb"/>
</connectionStrings> ......