|
Rather than building a query string embedding the parameter value (can we say SQL Injection[^]?), I'd suggest you build a parameterised query[^].
For what you want, this would want something like:
Cmd1.CreateInstance( __uuidof( ADODB::Command ) );
Cmd1->ActiveConnection = your connection;
Cmd1->CommandText = _bstr_t(L"SELECT Name FROM EmployeeDetails WHERE Name=?");
Param1 = Cmd1->CreateParameter( _bstr_t(L""),
ADODB::adVarChar,
ADODB::adParamInput,
-1,
_variant_t(_bstr_t(m_EditBoxValue) );
Cmd1->Parameters->Append( Param1 );
m_pRS = Cmd1->Execute( &vtEmpty, &vtEmpty2, ADODB::adCmdText );
To use the LIKE operator, just replace WHERE Name=? with WHERE Name LIKE ?
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
The Recordset does open but trying to fill the datagrid gives the error.
"Recordset not bookmarkable", I have set the Cursorlocation=adUseClient.
Any ideas.
|
|
|
|
|
Try setting the CursorType property of the Recordset to adOpenStatic
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Hi,
Is anyone familiar with the MAPI embedded attachments? I need to combine a message from my code, and attach an Image inside the message, so it will be visible as an image.
I was able to find an article from Microsoft that is supposed to explain how to do it(http://support.microsoft.com/kb/168903[^], but when I do it Outlook tells me (at the top of the new message) that the attachment was blocked since it unsafe. Does anybody have a clue? A code that does it or what flags / functions can solve it?
Thanks,
Yakobom
|
|
|
|
|
yakobom wrote: Outlook tells me (at the top of the new message) that the attachment was blocked since it unsafe.
All versions of Outlook since Outlook 2000 Service Release 1 (SR1) include a security feature that blocks attachments that might put your computer at risk for viruses or other threats. Although Outlook blocks access to the attachment, the attachment still exists in the e-mail message.
yakobom wrote: Does anybody have a clue? A code that does it or what flags / functions can solve it?
This[^] MSDN article gives more detail on this; no codes.
Look at the Advanced troubleshooting section of the article, I am sure you can do some tweaking with outlook registry entries to Outlook's attachment security behavior locally. Or you can ZIP the image and attach to a mail so that your recipients may not see a security warning.
|
|
|
|
|
First of all, thanks for your quick answer.
I am familiar with the security issue, but I'm afraid my problem is a bit more complex than that - I am able to attach images in the 'regular' way (as an attachment), the problem is only when I try to embed it (so the image will appear as a part of the text). This is why I believe what you suggest cannot help me...
Any other ideas?
Yakobom
|
|
|
|
|
yakobom wrote: This is why I believe what you suggest cannot help me...
Sorry for that!
yakobom wrote: Any other ideas?
I haven't played much with MAPI; How about attaching certificate[^] with your message so that outlook may identify your mail as a 'safe' one ? Please look at this, and check whether this works for you... [Just a suggestion, and am not sure about this approach]
There are lot of samples on MAPI programmes here[^]; I think you may get some more ideas from there.
|
|
|
|
|
Hi,
Our project(client\server application) support redundancy(i.e there 2 running servers,one of them is the root and the other is the secondary,and there are multiple clients connected to each one of the servers.once the root server is down,the secondary becomes the root server and continue to serve the clients from the same location the other server stopped).
The servers uses PING messages between them to realize when a server(which can be the root server) is down(to switch to another root).
In addition,we wrote some kind of watchdog application,which is running on each server,and which is being notified by it's server(keep alive events).
In case that the watchdog didn't get such keepalive event for a predefined period of time(for example - the server is in endless loop) - the watchdog resets it's server in order to let another server to become a root server.
So far so good
During one of our unit test,we encountered a problem which causes the operating system(Windows XP) of the root server to hangs(note that not only the server application hangs but the computer is not responding).
In such case the watchdog application is not working also,therefor - cannot reset the root server.
You probably ask yourself:
"So whats the problem?
The other server will try to PING to the other root server,and since the PING process will fail,the
other server will become the root server."
Well......you're wrong!!!!!
For some reason,though the operating system hangs - it still response to PING request.
Now for the questions...
1. We're looking for an API which causes the operating system to hangs (so when we'll fiind a
solution we will be able test it.
2. Is there another way to stop PING handling while the operating system hangs?
3. Is there a built in watchdog mechanism in Windows XP that we can use(or another watchdog
application which runs in a lower level and can reset the computer in case that the operating
system hangs?
Sorry for the (very) lonk post...
With best regards,
Eli
|
|
|
|
|
Create a high priority thread with an infinite loop.
This should screw up the system quite bad.
SetPriorityClass
SetThreadPriority
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
I don't think it wil work since it is a dual-core computer - so only one CPU will be stucked..
Eli
|
|
|
|
|
You're right. It won't work.
You could try to starve memory using the /burnmemory switch.
Boot Parameters to Manipulate Memory[^]
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
Thanks for your reply,I will try that.
In case it is working - is it mean that ,for some reason,the operating system can't get enough physical memory(which is very weird because it is not consistent).
Thanks again,
Eli
|
|
|
|
|
That option is just to simulate a machine with less physical memory.
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
eli15021979 wrote: 1. We're looking for an API which causes the operating system to hangs (so when we'll fiind a
solution we will be able test it.
What if you turned off ICMP replies from the server?
"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,
How can i programming direct map using c++?
|
|
|
|
|
Hello
You can use the one from the STL. have a look to std::map.
Regards
Franck
|
|
|
|
|
How can I change or move the icons of an existing too bar? In other words, I would like to insert an icon like in the middle, How do I create room for it?
Thanks
sft
|
|
|
|
|
Goto Resource Menu. select toolbar. then select the last icon. this can be modified according to your needs. you just need to drag and drop the menu items to the place where you like.
All the best.
|
|
|
|
|
dear all
i have read something in internet how to call c++ .dll, and tried to declare functions in vb 6, but however after i compiled, the error was there:" can't find DLL entry point in xxxx.dll". so how to invoke the c++ member function in one .dll, someone can give me help to realize step by step. thanks a lot in advance.
note: probably one library has several classes, so how can i know which library i can use or how to use it?
rgds
modified on Wednesday, May 13, 2009 9:09 PM
|
|
|
|
|
Are you exporting the C++ class from the DLL?
If so, the member function names are mangled and exported.
Use a tool like depends.exe that comes along with Visual Studio and look at the exported function name.
Use the same name in your VB code.
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
thanks for your reply. i didn't export. how to export it? i got .DLL only with object file library. as well as documentation. thanks
|
|
|
|
|
Read the documentation for Exporting from a DLL[^]
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
thanks a lot. i have read the articles how to export functions names in .dll. but this .dll was created by user. so here i just got .dll. nothing else, so how to export the function names? thanks.
|
|
|
|
|
Do you mean somebody else has created the dll and not you?
If so, the functions have already been exported.
Use Dependency Viewer (depends.exe) and open the dll file.
It will list all the functions that have been exported.
Check the actual name of the function and use that in the VB code.
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
yes, somebody already created the .dll, i just would like to use it. so how i can use these function directly? also one library has several classes, how to use it properly? thanks..
|
|
|
|