Click here to Skip to main content
15,887,676 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 19:16
Nibu babu thomas28-Feb-06 19:16 
GeneralRe: How to hide standard toolbar in my simple appliation by default? Pin
G Haranadh28-Feb-06 19:49
G Haranadh28-Feb-06 19:49 
AnswerRe: How to hide standard toolbar in my simple appliation by default? Pin
Cool Ju28-Feb-06 19:47
Cool Ju28-Feb-06 19:47 
QuestionMovePrev() can't works Pin
mikobi28-Feb-06 18:57
mikobi28-Feb-06 18:57 
AnswerRe: MovePrev() can't works Pin
David Crow1-Mar-06 3:27
David Crow1-Mar-06 3:27 
GeneralRe: MovePrev() can't works Pin
mikobi1-Mar-06 20:05
mikobi1-Mar-06 20:05 
GeneralPlease help me Pin
J51219826-Mar-06 19:21
J51219826-Mar-06 19:21 
GeneralRe: Please help me Pin
mikobi6-Mar-06 22:58
mikobi6-Mar-06 22: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 2:59
J51219827-Mar-06 2:59 
GeneralRe: Please help me Pin
mikobi7-Mar-06 20:37
mikobi7-Mar-06 20:37 
GeneralRe: Please help me Pin
mikobi7-Mar-06 20:49
mikobi7-Mar-06 20:49 
GeneralRe: Please help me Pin
J51219827-Mar-06 22:35
J51219827-Mar-06 22:35 
Questionriends,How to create an Installable version of our project Pin
Yuthav28-Feb-06 18:49
Yuthav28-Feb-06 18:49 
AnswerRe: riends,How to create an Installable version of our project Pin
Cool Ju28-Feb-06 19:39
Cool Ju28-Feb-06 19:39 
Question#error directive Pin
QuickDeveloper28-Feb-06 18:47
QuickDeveloper28-Feb-06 18:47 
AnswerRe: #error directive Pin
Nibu babu thomas28-Feb-06 19:12
Nibu babu thomas28-Feb-06 19:12 
GeneralRe: #error directive Pin
QuickDeveloper28-Feb-06 19:21
QuickDeveloper28-Feb-06 19:21 
QuestionRe: #error directive Pin
Nibu babu thomas28-Feb-06 19:23
Nibu babu thomas28-Feb-06 19:23 
AnswerRe: #error directive Pin
QuickDeveloper28-Feb-06 19:31
QuickDeveloper28-Feb-06 19:31 
GeneralRe: #error directive Pin
Nibu babu thomas28-Feb-06 19:36
Nibu babu thomas28-Feb-06 19:36 
QuestionRe: #error directive Pin
David Crow1-Mar-06 3:30
David Crow1-Mar-06 3:30 
Questionriends,How to create an Installable version of our project Pin
Yuthav28-Feb-06 18:47
Yuthav28-Feb-06 18:47 
QuestionCalling opengl's DrawGLScene() function in an MFC window Pin
adiilah28-Feb-06 18:33
adiilah28-Feb-06 18:33 
QuestionHow to implement List View Control Pin
janisha28-Feb-06 18:14
janisha28-Feb-06 18:14 
AnswerRe: How to implement List View Control Pin
Ryan Binns28-Feb-06 18:19
Ryan Binns28-Feb-06 18: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.