Click here to Skip to main content
15,846,727 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: How to hide standard toolbar in my simple appliation by default? Pin
Nibu babu thomas28-Feb-06 20:16
Nibu babu thomas28-Feb-06 20:16 
GeneralRe: How to hide standard toolbar in my simple appliation by default? Pin
G Haranadh28-Feb-06 20:49
G Haranadh28-Feb-06 20:49 
AnswerRe: How to hide standard toolbar in my simple appliation by default? Pin
Cool Ju28-Feb-06 20:47
Cool Ju28-Feb-06 20:47 
QuestionMovePrev() can't works Pin
mikobi28-Feb-06 19:57
mikobi28-Feb-06 19:57 
AnswerRe: MovePrev() can't works Pin
David Crow1-Mar-06 4:27
David Crow1-Mar-06 4:27 
GeneralRe: MovePrev() can't works Pin
mikobi1-Mar-06 21:05
mikobi1-Mar-06 21:05 
GeneralPlease help me Pin
J51219826-Mar-06 20:21
J51219826-Mar-06 20:21 
GeneralRe: Please help me Pin
mikobi6-Mar-06 23:58
mikobi6-Mar-06 23:58 
To retrieve data from SQL SERVER, make first an Accessor.Do that in your project workspace:

Click on Insert -> New ATL Object; in catégories choice Data Access->Consumer from here enter the name of your database; password;choice command and click on ok after choice the table you want to access, click in ok again.

Here a Class Accessor is generate.

Now in your event write this code :

bool bsavevalidation = true;
CWnd::UpdateData(bsavevalidation);
HRESULT hr;
CDataSource db;
CDBPropSet dbinit(DBPROPSET_DBINIT);

CString strItem;
int k = 0;
CSession session;
CString strCommand,strSql;
dbinit.AddProperty(DBPROP_AUTH_PASSWORD, OLESTR("yhwha"));
dbinit.AddProperty(DBPROP_AUTH_PERSIST_SENSITIVE_AUTHINFO, false);
dbinit.AddProperty(DBPROP_AUTH_USERID, OLESTR("sa"));
dbinit.AddProperty(DBPROP_INIT_CATALOG, OLESTR("STOCK"));
dbinit.AddProperty(DBPROP_INIT_DATASOURCE, databas);
dbinit.AddProperty(DBPROP_INIT_LCID, (long)1036);
dbinit.AddProperty(DBPROP_INIT_PROMPT, (short)4);
hr = db.Open(_T("SQLOLEDB.1"), &dbinit);
if (FAILED(hr))
{
AfxMessageBox("impossible d'ouvrir la baseo");
}
else
{

hr = session.Open(db);
if (FAILED(hr))
{
AfxMessageBox("session non Ouverte");
}
else
{

CDBPropSet propset(DBPROPSET_ROWSET);
propset.AddProperty(DBPROP_CANFETCHBACKWARDS, true);
propset.AddProperty(DBPROP_IRowsetScroll, true);
propset.AddProperty(DBPROP_IRowsetChange, true);
propset.AddProperty(DBPROP_UPDATABILITY, DBPROPVAL_UP_CHANGE | DBPROPVAL_UP_INSERT | DBPROPVAL_UP_DELETE );
bool bsavevalidation = true;
CWnd::UpdateData(bsavevalidation);
CCommand<caccessor<cdbotabcmdeaccessor> >cmde ;
CCommand<caccessor<cdborequisitionaccessor> >req ;
CCommand<caccessor<cdbodemprixaccessor> >dem ;
CCommand<caccessor<cdbodetcmde2accessor> >det ;
CCommand<caccessor<cdbodetlivaccessor> >liv ;
CString str1,str2,str3,str4,str5,str6,str7,str8,str9,str0 = "";
int i = 0;
strCommand = "select * from detcmde where numreq = '%s'";
strSql.Format(strCommand,m_numcmde);

hr = det.Open(session, strSql,NULL);
if (det.MoveFirst() != S_OK)
{
GeneralRe: Please help me Pin
J51219827-Mar-06 3:59
J51219827-Mar-06 3:59 
GeneralRe: Please help me Pin
mikobi7-Mar-06 21:37
mikobi7-Mar-06 21:37 
GeneralRe: Please help me Pin
mikobi7-Mar-06 21:49
mikobi7-Mar-06 21:49 
GeneralRe: Please help me Pin
J51219827-Mar-06 23:35
J51219827-Mar-06 23:35 
Questionriends,How to create an Installable version of our project Pin
Yuthav28-Feb-06 19:49
Yuthav28-Feb-06 19:49 
AnswerRe: riends,How to create an Installable version of our project Pin
Cool Ju28-Feb-06 20:39
Cool Ju28-Feb-06 20:39 
Question#error directive Pin
QuickDeveloper28-Feb-06 19:47
QuickDeveloper28-Feb-06 19:47 
AnswerRe: #error directive Pin
Nibu babu thomas28-Feb-06 20:12
Nibu babu thomas28-Feb-06 20:12 
GeneralRe: #error directive Pin
QuickDeveloper28-Feb-06 20:21
QuickDeveloper28-Feb-06 20:21 
QuestionRe: #error directive Pin
Nibu babu thomas28-Feb-06 20:23
Nibu babu thomas28-Feb-06 20:23 
AnswerRe: #error directive Pin
QuickDeveloper28-Feb-06 20:31
QuickDeveloper28-Feb-06 20:31 
GeneralRe: #error directive Pin
Nibu babu thomas28-Feb-06 20:36
Nibu babu thomas28-Feb-06 20:36 
QuestionRe: #error directive Pin
David Crow1-Mar-06 4:30
David Crow1-Mar-06 4:30 
Questionriends,How to create an Installable version of our project Pin
Yuthav28-Feb-06 19:47
Yuthav28-Feb-06 19:47 
QuestionCalling opengl's DrawGLScene() function in an MFC window Pin
adiilah28-Feb-06 19:33
adiilah28-Feb-06 19:33 
QuestionHow to implement List View Control Pin
janisha28-Feb-06 19:14
janisha28-Feb-06 19:14 
AnswerRe: How to implement List View Control Pin
Ryan Binns28-Feb-06 19:19
Ryan Binns28-Feb-06 19:19 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.