ÈçºÎͨ¹ýADOʹÓþۺϺ¯ÊýÀ´²éѯ(Êý¾Ý¿âΪACCESS)
_RecordsetPtr CMyAdo::SelectRecord(string &where, string &tablename,string &field, int way )
{
int ret = 0;
_RecordsetPtr pset;
CString sql;
VARIANT count;
count.vt = VT_INT;
ret = OpenDB();
if( ret == 1 )
return -1; //´´½¨¶ÔÏóʧ°Ü
else if( ret == 2 )
return -2; //Êý¾Ý¿â´ò¿ªÊ§°Ü
try
{
sql.Format("select count(*) from %s", tablename.c_str() );
/*if( way == 0 ) //²éѯȫ²¿
{
sql.Format("select * from %s", tablename.c_str() );
TRACE("sql = %s\n",sql);
}
else if( way == 1 ) //°´×ֶβéѯ
sql.Format("select %s from %s", field.c_str(), tablename.c_str() );
else if( way == 2 ) //°´Ìõ¼þÈ«²¿²éѯ
{
}
else if( way == 3 ) //°´Ìõ¼þºÍ×Ö¶ÎÁªºÏ²éѯ
{
}*/
pset = m_dbptr->Execute((_bstr_t)sql.GetBuffer(sql.GetLength()),&count,adCmdUnknown);
if( pset != NULL && !pset->ADOEOF )
retu
Ïà¹ØÎÊ´ð£º
<?php
include("adodb/adodb.inc.php");
$db = &NewADOConnection("access");
$access = realpath("Data.mdb");
$dsn = "Provider=Microsoft.J ......
±¾À´ÎÒÊÇÓÃACCESS+VB½¨Á¢Ò»¸öÈí¼þ£¨¾ÖÓòÍø£©£¬ÏÖÔÚÓÉÓڰ칫µØµãÓб䶯£¬Ïà»»³ÉINTERNATµÄ£¬ÓÐûÓа취½â¾ö£¬
ÏóÕâÑùµÄÇé¿ö£¬Èç¹ûÊǹãÓòÍø£¬×îºÃ¸Ä³É£ºB\SµÄ
Èç¹ûÊǾÖÓòÍøµÄ£¬×îºÃ¸Ä³É£ºC\SµÄ
http://downlo ......
VB+Access×öµÄϵ統£¬
Ôõ樣°Ñ數據庫Access內ÈÝ導³öexecl£¿
ÏÖÔÚû¶«Î÷ÊÔ£¬´ÓÍøÉÏÕÒÁ˶δúÂëÄã¿´¿´
VB code:
Private Sub ExportOneTable()
'EXPORTS TABLE IN ......
ÎÊÌâÈçÏ£º
ÓòéѯÓï¾ä
select * from tab where fil like 'CK090902'ÄܲéÕÒ³öÒ»Ìõ¼Ç¼²¢ÏÔʾ³öÀ´
¸ÄΪ
select * from tab where fil = 'CK090902'
¾Í²»ÄܲéÕÒµ½£¬Ò²ÏÔʾ²»³öÀ´ ......
SQL code:
select count(1) from HouseList a left join MemberList b on
(a.OperationName=b.UName and a.Eid=1 and a.houselc='2')
ÒÔÉÏÕâÌõÓï¾äÔÚsql2005ÖвéѯµÃµ½760Ìõ¼Ç¼,·ÅÔÚaccessÖвéѯֻÓÐ14Ì ......