使用Visual C ++ Express连接到Access 2000

时间:2022-11-09 15:39:02

I have used the Borland IDE to connect to Access Databases for a while now but Borland got bought and the upgrade is more than I can afford so I am trying to switch to Visual C++ Express. I can get the explore data to show my databases how do I get from there to being able to read the records and work with them?

我已经使用Borland IDE连接到Access数据库一段时间了但是Borland被买了,升级超出了我的承受能力,所以我试图切换到Visual C ++ Express。我可以获取探索数据来显示我的数据库如何从那里获得能够读取记录并使用它们?

Which controls do I need and what do the properties need to be set too? The rest I can do.

我需要哪些控件以及需要设置哪些属性?剩下的我能做到。

Any assistance would be appreciated.

任何援助将不胜感激。

TIA oldgrizz@sbcglobal.net

1 个解决方案

#1


Take a look at this set of ADO classes, full source with samples at codeproject http://www.codeproject.com/KB/database/caaadoclass1.aspx

在codeproject上查看这组ADO类,完整源代码和样本http://www.codeproject.com/KB/database/caaadoclass1.aspx

Opening Access database (quoted from article):

打开Access数据库(引自文章):

//Sample with Connection String for Access database


CADODatabase* pAdoDb = new CADODatabase();
CString strConnection = _T("");

strConnection = _T("Provider=Microsoft.Jet.OLEDB.4.0;"
              "Data Source=C:\\VCProjects\\ADO\\Test\\dbTest.mdb");
pAdoDb->SetConnectionString(strConnection);

if(pAdoDb->Open())
{
  DoSomething();
  .
  .
  .
  pAdoDb->Close();
}

delete pAdoDb;

#1


Take a look at this set of ADO classes, full source with samples at codeproject http://www.codeproject.com/KB/database/caaadoclass1.aspx

在codeproject上查看这组ADO类,完整源代码和样本http://www.codeproject.com/KB/database/caaadoclass1.aspx

Opening Access database (quoted from article):

打开Access数据库(引自文章):

//Sample with Connection String for Access database


CADODatabase* pAdoDb = new CADODatabase();
CString strConnection = _T("");

strConnection = _T("Provider=Microsoft.Jet.OLEDB.4.0;"
              "Data Source=C:\\VCProjects\\ADO\\Test\\dbTest.mdb");
pAdoDb->SetConnectionString(strConnection);

if(pAdoDb->Open())
{
  DoSomething();
  .
  .
  .
  pAdoDb->Close();
}

delete pAdoDb;