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
Ïà¹ØÎĵµ£º
#include "iostream.h"
#include "stdio.h"
#import "C:\program files\common files\system\ado\msado15.dll" no_namespace rename("EOF","adoEOF")
int main(int argc, char* argv[])
{
::CoInitialize(NULL);
_ConnectionPtr m_pConnection;
m_pConnection.CreateInstance("ADODB.Connection");
tr ......
1.now() »ñÈ¡µ±Ç°Ê±¼ä£»
2.¹ØÓÚAccessÄÚ²¿µÄÄ£ºý²éѯ£º
ÔÚC#ÀïдӦд³É Select * from Table Where Name Like '%ABC%'
Select * from Table Where Name Like '_AB ......
1¡¢VSS¿Í»§¶Ë´ò¿ª¹¤³ÌʱÌáʾ Access to file"\\***\rights.dat" denied
¸ÃÌáʾÊÇָûÓÐÍøÂç·ÃÎʵÄȨÏÞ£¬Óû§ÒªÔÚ¹²ÏíÎļþ¼ÐÓпÉдµÄȨÏ޲ſÉÒÔ¡£ÎÒÃÇÔÚÉèÖù²ÏíÎļþµÄʱºòÓ¦¸ÃÔÊÐíдÈë¡£
2¡¢ÎªVSSÉèÖû·¾³±äÁ¿
ĬÈÏÇé¿öÏÂÎÒÃÇÿ´Î´ò¿ªVSS¿Í»§¶ËÌî³äµÄÓû§Ãû¶¼Êǵ±Ç°ÏµÍ³µÇ½µÄÓû§£¬ÕâÑùʹÓÃÆðÀ´ºÜ²»·½±ã¡ ......
<connectionStrings>
<add name="qxConnectionString" connectionString="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=Web/App_Data/db2.mdb;" providerName="System.Data.OleDb"/>
</connectionStrings> ......