|
hi
how is it possible to call an oracle procedure from my vc++ application. i have tried it with the oracle ole c++ library, but this method doesn´t work because this library isn´t maturad enough, like there are several exceptions, when i connect to the db or when i call MoveNext in a dynaset object. I have read about an solution with the ole db dataprovider from oracle, but the problem is, that this works with COM and COM+ and so it is to complicated for me, because i am not experienced in COM.
Is there any simple solution for my problem?
thanks
ownlife
|
|
|
|
|
I use ADO all the time to call Oracle stored procedures from VC++ applications.
Simply create an ADO connection, create a command object and execute it. There are some issues with returning Recordsets but these can be sorted by a few changes to the stored procedures.
Michael
Time flies like an arrow. Fruit flies like a banana
|
|
|
|
|
I have a lot of fields in my database. I want to include all but one in my search. I dont want to have to type the names of all the fields in my SQL search like this:
SELECT Aa,b,c,d....FROM Table
Is there something like
SELECT * From Table BUT NOT xyz
?
Thanks,
ns
|
|
|
|
|
nope, not possible.
But (unless the field is type text or ntext or some other blob), it's probably quicker to use * and just not use the field. If you specify a finite set of columns to return, you'll slow your query down some.
STL is a religeon. Enquiries to Reverend Christian Graus
|
|
|
|
|
Okay, thanks. I am putting my fields in a listbox, and didnt want my blob field to show up. SO ii suppose I'll test for it and exclude it while populating the box.
ns
|
|
|
|
|
You can go the lazy route and just use *. But if your blob data can be large I would consider it a worthy optimization to type out all of the fields. You could use a stored procedure to keep from having to type it multiple times.
Todd Smith
|
|
|
|
|
Great optimization observation. I'm in a catch-22 situation though - I dont know how many fields there are, or what the names are. SO I do a select * and iterate through the fields to get that info. (I populate a listctrl with the names, so I was contemplating catching the blob field name and filtering it out). I f I'm missing something obvious, I'd like to know....
Thanks,
ns
|
|
|
|
|
Try to use view instead of table for search.
|
|
|
|
|
WEll,
This means I go in search of what a view is. None of the simple SQL stuff and basic db stuff I've seen (and its very little) speaks of views. If you have any links let me know.
Thanks,
ns
|
|
|
|
|
Something like below. Same way you write a SQL statement to create table. Reasons you write one is to help organise your SQL statement call and optimize in some sense as it will be compiled into an object in your DBMS.
create or replace view v_something as
select S.ID, S.CODE, U.NAME
from
salesman s, user u
where
U.id = S.User_ID
with read only
|
|
|
|
|
Is there a way to optain a pointer to the device context of a CFontDialog box before opening it?
My dog is anisotropic, but he doesn't scale easily like this mapping mode does... Practical C++ Jon Bates and Tim Tompkins
|
|
|
|
|
In my dialog based application I modify the background of
the dialog ,now they looks very nice.
But in my application I also use MessageBox() to send some information to user,but their background is still grey.
How can I change the background of MessageBox()?
any help will be appr eciate ,thanks.;)
|
|
|
|
|
fyl_jf wrote:
How can I change the background of MessageBox()?
AFAIK, there's no easy way for that. You may try to use MFC approach: set the WH_CBT hook before calling MessageBox, subclass the message box and modify the background by intercepting WM_ERASEBKGND.
Tomasz Sowinski -- http://www.shooltz.com
What is "scratch" and why can everything be made from it?
|
|
|
|
|
Thanks for your help!
but I'm a beginner,and I don't know how to set the WH_CBT
hook.Can you explain it more clearly or post code to me?
|
|
|
|
|
Hi,
I have a CFormView based application. The dialog is created using the dialog editor. When I compile and run the program the initial size of the window is always too small to show all controls, resulting in ugly scrollbars.
I am looking for a smart way that ensures that the initial size of the application window is just big enough to show all controls.
How do I do this?
Woody
|
|
|
|
|
Look at WM_GETMINMAXINFO. You can specify the min and max size of your frame, so your formview fits.
Michael
Time flies like an arrow. Fruit flies like a banana
|
|
|
|
|
Thanks. One more question. How do I determine the required size. For example, I draw four listboxes next to each other. How do I determine the total size of these listboxes and thus the total dialog size.
Woody
|
|
|
|
|
|
Hi!
I am trying to build an SDI with some dialog box in it. Those dialog box contain buttons. I want be able to click those button and then retreive data from my CDoc derived class and then do some process with it. After that I want to update the list box in the dialog box.
I've tried adding message handler in the dialog box class but then I can't process the data as I can't get to the data in CDoc like the CView class did by using GetDocument(). I've tried many things but it did not work. Can a button in dialog box be used to invoke a function in CDoc or CView derived class?
Does anyone knows how to retrieve and send data from dialog box to CDoc derived class or CView derived class? I desperately need some example
Newbies
|
|
|
|
|
Add a document pointer to your dialog class and set it before calling DoModal(). This will give you access to the document when the user clicks the button:
class CMyDlg : public CDialog<br />
{<br />
public:<br />
CMyDocument *pDoc;<br />
};<br />
<br />
CMyDocument::OnShowDlg()<br />
{<br />
CMyDlg dlg;<br />
dlg.pDoc = this;<br />
}
Capixx?
Drinking In The Sun
Forgot Password?
|
|
|
|
|
I had exactly the same Q. My understanding, however, is that the dialog should be placed in the view, and not the document. the 'CMyDocument::OnShowDlg()' line in one of the replies before implies that the dialog is not part of the view. Is that correct?
Isn't there a way to have the DDX from the dialog directly update member variables in the document class? Dialogs updating document class(es) seems to be such a common occurence, such that someone must have a straightforward answer to this. Thx you all,
Ralf.
ralf.riedel@usm.edu
|
|
|
|
|
Hey Zayax,
I'm new too, but I think you want to use DDX. Essentially, you create a link between the dialog and it's parent, and transfer info that way. I'm still learning about, and it's caused me some headaches over the past few days, but try that direction in your searching.
Hope that helps some.
BW
{insert witty/thought-provoking saying here}
|
|
|
|
|
Special thanks to all the Gurus that had help me. Sorry I can't respond earlier to your reply because my internet provider connection has been down until now. Your advice has worked. Keep up the good work. Arigato Gozaimashita
Newbies
|
|
|
|
|
For using Smart Pointer, it'll handle all reference counting for me. However, for some cases, I couldn't use it.
Can anyone tell me the following functions if AddRef() is called automatically, or I should call it explicitly.
1. CComObject<t>::CreateInstance()
2. CComObject<t>::QueryInstance()
3. CoCreateInstance()
4. SmartPtr->CreateInstance() -- (i supposed addref-ed auto)
5. SmartPtr->QueryInterface() -- (i supposed addref-ed auto)
6. pUnknown->QueryInterface()
I see from many samples, the codes are just called CoCreateInstance() or pUnknown->QueryInterface() to return the pointer directly without calling AddRef(). It will do automatically ?
|
|
|
|
|
All of those functions call add ref before returning the pointer.
QueryInterface calls Addref internally before returning the new interface that you are querying.
CComObject::CreateInstance calls CoCreateInstance, which internally calls QueryInterface.
Are you having any particular problems, or are you just making sure?
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|