|
i think MAP API is there ..i hope it would help 4 u ...
|
|
|
|
|
Hi,
I have one SQL query, i want to update it in one database. Please check that SQL query below.
update employee set emp_name = 'Ravi' where emp_id = 1
I know that the below query will help me to get the records count..
update employee set emp_name = 'Ravi' where emp_id = 1; Select @@Rowcount Updated
But i want to execute this query through my VC++ code.. Cany one help me out how to execute this query and how to retrieve no of records updated count as return value..?
Can any one help me out as it urgent requirement for me..
Thanks
John.
|
|
|
|
|
I think you should start here[^].
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Sometimes you just have to hate coding to do it well. <
|
|
|
|
|
Try Like this
char *name="ravi";
int index=1;
CString str=_T("update employee set emp_name =");
str.format("'%s' where emp_id=%d",name,index);
and pass str as argument to ur Execute query...
Hope it is ur answer wat ur looking for it.
Can u please tell me what are the settings that we need in project to connect to database from VC++. please share it so that it wil be help full for me please
|
|
|
|
|
John502 wrote: Cany one help me out how to execute this query...
Have you tried SQLExecute() ?
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
Hi there,
quick question. How can one use the system() call to start an external exe with a wstring (WCHAR) as parameter?
Or is there an alternative?
Souldrift
|
|
|
|
|
Nevermind .. I found it ... _wsystem().
*blush*
Souldrift
|
|
|
|
|
Hi,
I have a console program (.exe) that i want to call from a C++ program. How do I pass the parameters to the console program from my C++ program.
Thank you in advance!!
BAC
|
|
|
|
|
 Use this function which does CreateProcess with the parameter u want
size_t ExecuteProcess(std::wstring FullPathToExe, std::wstring Parameters, size_t SecondsToWait)
{
size_t iMyCounter = 0, iReturnVal = 0, iPos = 0;
DWORD dwExitCode = 0;
std::wstring sTempStr = L"";
if (Parameters.size() != 0)
{
if (Parameters[0] != L' ')
{
Parameters.insert(0,L" ");
}
}
sTempStr = FullPathToExe;
iPos = sTempStr.find_last_of(L"\\");
sTempStr.erase(0, iPos +1);
Parameters = sTempStr.append(Parameters);
wchar_t * pwszParam = new wchar_t[Parameters.size() + 1];
if (pwszParam == 0)
{
return 1;
}
const wchar_t* pchrTemp = Parameters.c_str();
wcscpy_s(pwszParam, Parameters.size() + 1, pchrTemp);
STARTUPINFOW siStartupInfo;
PROCESS_INFORMATION piProcessInfo;
memset(&siStartupInfo, 0, sizeof(siStartupInfo));
memset(&piProcessInfo, 0, sizeof(piProcessInfo));
siStartupInfo.cb = sizeof(siStartupInfo);
if (CreateProcessW(const_cast<LPCWSTR>(FullPathToExe.c_str()),
pwszParam, 0, 0, false,
CREATE_DEFAULT_ERROR_MODE, 0, 0,
&siStartupInfo, &piProcessInfo) != false)
{
dwExitCode = WaitForSingleObject(piProcessInfo.hProcess, (SecondsToWait * 1000));
}
else
{
iReturnVal = GetLastError();
}
delete[]pwszParam;
pwszParam = 0;
CloseHandle(piProcessInfo.hProcess);
CloseHandle(piProcessInfo.hThread);
return iReturnVal;
}
|
|
|
|
|
Reading CreateProcess function documentation [^] may help.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Hello Friends
I created a .exe and when I try to run that It shows a MessageBox that Displays
"The Application failed to initialize properly(0Xc0150002).Click on OK to terminate the application"
Any Ideas?????
Thanks
Yogesh
|
|
|
|
|
yogeshs wrote: I created a .exe
How?
yogeshs wrote: Any Ideas?????
Yes, click on OK to terminate the application.
|
|
|
|
|
very funny 
|
|
|
|
|
Ever looked in your windows event log for this error?
Greetings
Covean
|
|
|
|
|
Use the debugger.
“Follow your bliss.” – Joseph Campbell
|
|
|
|
|
|
Thanks for your help but it is still showing that message Box.
|
|
|
|
|
Is it a normal exe or MFC ? can u detail more about what debugging techniques are yu using .. have u seen event viewer of your computer to see if an exception was thrown by ur aplication ??
|
|
|
|
|
Actually,we are using a third party exe.So I cant debug and nothing.I just want to run it on my machine and it is running there with third party.
|
|
|
|
|
Check ur file system and the filesystem n their machine normally this happens if there are filesystem differences FAT or NTFS . Or check with which Service pack they are running and what is you service pack of OS. also might be the case it requires Dotnet framework which you machhine doesnot have. Please see your event log and let me know cause of crash in your application .
|
|
|
|
|
yogeshs wrote: Actually,we are using a third party exe
In your original post you said you created the .exe. 
|
|
|
|
|
|
Did you try using depends.exe to see if all the required files are present in the machine you are trying to run this application?
modified on Thursday, July 8, 2010 11:58 PM
|
|
|
|
|
I tried that too but no success.
|
|
|
|
|