Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do i retrieve MsAccess Data into a COMBOBOX

Status
Not open for further replies.

markshian

Programmer
Jun 5, 2002
1
0
0
MY
Hi,
Could anyone please help me with a problem. I'm building an SDI application in timetabling.

And first, i need to know how i can retrieve data from access for example"Lecturers" into a lecturer combobox in Visual C++.

Secondly, How do i feed the same kind of information into a tree list? (data from the access database).

lastly, How do i retrieve a value from the database, for ex. Date:1/5/2002 and Time now is 1:00pm. Add coding to increment this date by (X) days and time by (Y) hours.
And then produce an output.

Would appreciate your time and efffort very much!
Thank you.
 
You have to create a Recordset class:
I am giveing u some other example
class CWdasDataSet : public CRecordset
{
public:
long GetLastBagCount(int m_packerID,int m_spoutID);
long CreateNewRecordID();

CWdasDataSet(CDatabase* pDatabase = NULL);
DECLARE_DYNAMIC(CWdasDataSet)

// Field/Param Data
//{{AFX_FIELD(CWdasDataSet, CRecordset)
long m_RecordNo;
int m_PackerNo;
}

Then from the formview/record view class, u have to call them like as under:

static_cast<CWdasMainDoc*>(GetDocument())->
m_wdasDataSet.GetLastBagCount(3,j);


After getting the values , on_init_view () , u can put them inside a combo/list box

In any doubt manoj.padhi@alcatel.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top