The code below was written using C++.NET framework. How will the code be completed to retrieve all the records from microsoft access 2003 table PROFILE and display them in a form?

private: System::Void Form1_Load(System::Object^  sender, System::EventArgs^  e) {
	ADODB::Recordset ^ rst=gcnew ADODB::Recordset;
	ADODB::Connection ^ conADO;
	Object ^ obj;
	String ^ strConnection;
	String ^ Query;
	conADO=gcnew ADODB::Connection;
	obj=gcnew Object;
	strConnection=L"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\\Documents and Settings\\olu\\My Documents\\Visual Studio 2008\\Projects\\data_entry\\data_entry\\db1.mdb";
	Query=L"SELECT * FROM profile";
         rst->Open(Query,conADO,ADODB::CursorTypeEnum::adOpenKeyset, ADODB::LockTypeEnum::adLockOptimistic, -1);

No change necessary, other than possibly changing the data source in the connection string.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.18 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.