Click here to Skip to main content
15,904,024 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionHow to update a field in an DB using MFC Pin
moh.hijjawi9-Oct-09 4:20
moh.hijjawi9-Oct-09 4:20 
Hi all,
I am new in MFC. Shucks | :-\

I am struggling with one of my system's modules which is I need to edit filed's value in the data source depending on some variables.

My problem is I stuck with Recordset type because I making the editting via SQL statment and the following which are I done so far:


CDatabase DBDecaying;


CString SqlRulesDecaying;

CString sDriver("MICROSOFT ACCESS DRIVER (*.mdb)");
CString sDsn;
CString ssDSN("ODBC;DRIVER={%s};DSN='';DBQ=%s");
CString sFile("c:\\DB\\db.mdb");

sDsn.Format(ssDSN, sDriver, sFile);

DBDecaying.Open(NULL,false,false,sDsn);

CRecordset RecSetRulesDecaying( &DBDecaying );

int X=2,Y=3;
double NewActiLevel = 0;



SqlRulesDecaying.Format(_T("update Rules set RActiLevel=%f where CNum=%d and
RNum=%d"),NewActiLevel,X,Y);


RecSetRulesDecaying.Open(CRecordset::forwardOnly,SqlRulesDecaying,CRecordset::??????);

Regarding the first parameter I tried snapshot,dynaset and dynamic instead of forwardonly. nothing happens.

So what I should put insted of ???? I tried (Update,Can Update,..) but I had syntax errors.


So please any help will be appreciated.

Best regards.
AnswerRe: How to update a field in an DB using MFC Pin
David Crow9-Oct-09 4:48
David Crow9-Oct-09 4:48 
GeneralRe: How to update a field in an DB using MFC Pin
moh.hijjawi9-Oct-09 5:33
moh.hijjawi9-Oct-09 5:33 
QuestionRe: How to update a field in an DB using MFC Pin
David Crow9-Oct-09 5:38
David Crow9-Oct-09 5:38 
AnswerRe: How to update a field in an DB using MFC Pin
moh.hijjawi9-Oct-09 5:46
moh.hijjawi9-Oct-09 5:46 
QuestionSearching item in second column list control using find function Pin
Le@rner9-Oct-09 2:37
Le@rner9-Oct-09 2:37 
QuestionRe: Searching item in second column list control using find function Pin
David Crow9-Oct-09 3:37
David Crow9-Oct-09 3:37 
QuestionHow to remove C4389 Pin
KASR19-Oct-09 0:26
KASR19-Oct-09 0:26 
AnswerRe: How to remove C4389 Pin
sashoalm9-Oct-09 0:30
sashoalm9-Oct-09 0:30 
AnswerRe: How to remove C4389 Pin
transoft9-Oct-09 2:41
transoft9-Oct-09 2:41 
QuestionBG color for popup dialogs Pin
hellogany8-Oct-09 23:16
hellogany8-Oct-09 23:16 
AnswerRe: BG color for popup dialogs [modified] Pin
Hristo-Bojilov8-Oct-09 23:58
Hristo-Bojilov8-Oct-09 23:58 
AnswerRe: BG color for popup dialogs Pin
Anish C.V9-Oct-09 1:04
Anish C.V9-Oct-09 1:04 
Question[Message Deleted] Pin
Mogamboo_Khush_Hua8-Oct-09 22:51
Mogamboo_Khush_Hua8-Oct-09 22:51 
AnswerRe: problem in string searching Pin
minkowski8-Oct-09 22:56
minkowski8-Oct-09 22:56 
AnswerRe: problem in string searching Pin
Jijo.Raj8-Oct-09 23:10
Jijo.Raj8-Oct-09 23:10 
QuestionRe: problem in string searching Pin
CPallini8-Oct-09 23:50
mveCPallini8-Oct-09 23:50 
Questionquestion on using kdbg Pin
minkowski8-Oct-09 22:17
minkowski8-Oct-09 22:17 
QuestionProblem with CreateProcessAsUser( ) ? [modified] Pin
Kushagra Tiwari8-Oct-09 21:23
Kushagra Tiwari8-Oct-09 21:23 
AnswerRe: Problem with CreateProcessAsUser( ) ? Pin
Rajesh R Subramanian8-Oct-09 21:35
professionalRajesh R Subramanian8-Oct-09 21:35 
GeneralRe: Problem with CreateProcessAsUser( ) ? Pin
Kushagra Tiwari8-Oct-09 21:43
Kushagra Tiwari8-Oct-09 21:43 
QuestionQuestion regarding excel files Pin
Le@rner8-Oct-09 21:04
Le@rner8-Oct-09 21:04 
AnswerRe: Question regarding excel files Pin
Rajesh R Subramanian8-Oct-09 21:33
professionalRajesh R Subramanian8-Oct-09 21:33 
GeneralRe: Question regarding excel files Pin
kilt8-Oct-09 23:12
kilt8-Oct-09 23:12 
GeneralRe: Question regarding excel files Pin
Rajesh R Subramanian9-Oct-09 1:11
professionalRajesh R Subramanian9-Oct-09 1:11 

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.