|
Hello every body
I am using a CRecordset object but I want to make my own connection string, not defult,so how can i make this? is it don by using CDatabase Object and how?
Best Regards
|
|
|
|
|
If you are using access you can just give file path or if you use ODBC driver this is another example:
CDatabase aDB;
try
{
aDB.OpenEx("DSN=MyDSN");
CRecordset aRS(&aDB);
aRS.Open(CRecordset::forwardOnly,
"SELECT DISTINCT state FROM authors");
.
.
.
.
or another example for SQLServer(without ODBC) this is a connection string:
Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=NorthWind;Data Source=MAZY;Use Procedure for Prepare=1;Auto Translate=True;Packet Size=4096;Workstation ID=MAZY;Use Encryption for Data=False;Tag with column collation when possible=False
Mazy
"So,so you think you can tell,
Heaven from Hell,
Blue skies from pain,...
How I wish,how I wish you were here." Wish You Were Here-Pink Floyd-1975
|
|
|
|
|
I am currently playing with the concept of designing a custom toolbar from CControlBar, this is actually a lot more difficult than I thought.
I'm thinking i'll probably go with just deriving from CWnd and include some controlbar repositioning code (I don't need docking).
Shog9 pointed out that doing this is pointless because the short life expectancy of MFC(VS.NET and all) and the time required to design a toolbar isn't worth it. However I don't want to derive from CToolBar I wanna start from scartch. I'm an anus...no really my face looks like a colon(spelling).
Anyways...if i do derive from CWnd(although the fact MFC is dying slowly has no effect on me) what is the C# (probably the direction i'd go in, it's closer related to C++???) equivelant...? Or is there one...?
I'm dead set on starting from either CControlBar, but will probably end up deriving from CWnd, cuz I can't get nothing from CControlBar. Stupid thing is like my last girlfriend, so much work...so little profit...
Basically if I do this (even though it doesn't concern me really, yet anayway!) what is the probability of getting the same thing to work in later versions of VC++ 7.0+..?
Ciao!
"An expert is someone who has made all the mistakes in his or her field" - Niels Bohr
|
|
|
|
|
HockeyDude wrote:
Shog9 pointed out that doing this is pointless because the short life expectancy of MFC(VS.NET and all)
VS.NET has new version of MFC. What's the problem?
Tomasz Sowinski -- http://www.shooltz.com
- It's for protection - Protection from what? Zee Germans?
|
|
|
|
|
I was not aware of this.
For backwards compatibility...? I thought managed C++ was to do this...?
So there is a CWnd in VS.NET...?
"An expert is someone who has made all the mistakes in his or her field" - Niels Bohr
|
|
|
|
|
VS.NET ships with new, updated version of MFC. CWnd is still there.
Managed C++ is something entirely else.
Tomasz Sowinski -- http://www.shooltz.com
- It's for protection - Protection from what? Zee Germans?
|
|
|
|
|
Thanx Tomasz!
All I needed to hear.
Cheers!
"An expert is someone who has made all the mistakes in his or her field" - Niels Bohr
|
|
|
|
|
My program about ADO run correctly on my machine,but it can't correctly run on the machine whithout VisualC++ IDE. I find it runs the following statment:
_CommandPtr cmd;
_ConnectionPtr conn;
.......................................
cmd->ActiveConnection = conn;/Error occurs
I don't why.Can somebody help me!
Thanks very much!!
VCBeginer
|
|
|
|
|
Do you have the same version of MDAC installed on both machines? You can download it from the microsoft web site. www.microsoft.com/data
Michael
|
|
|
|
|
Oh! I get it. Thank you again!!
VCBeginer
|
|
|
|
|
namespace afilter {
:
:
template <typename cr,="" int="" i,="" o="">
ReplItr<cr,i,o>::ReplItr(const typename CR::Base & cr)
: repl(static_cast<const cr="" &="">(cr)), buffer(repl.max_out()) {}
template <typename cr,="" int="" i,="" o=""> // <--error C2954: template definitions cannot nest
ReplItr<cr,i,o> * ReplItr<cr,i,o>::clone() const {
return new ReplItr(*this);
}
:
:
}
why this error comes ?
error C2954: template
Is there any way to get rid of this ?
Regards,
_Nandika
|
|
|
|
|
Can Visual Studio .NET still use my old custom appwizards from 6.0? I can't find any way to incorporate my *.awx files into the new IDE.
|
|
|
|
|
Hi,
I have started a project(DLL) which was not using MFC. But I need to add some of my classes which are derieved from MFC to this project. So, I added stdafx.h with all MFC includes to this dll and included where ever necessary. But still I am getting compilation errors that the MFC classes are undefined.
Can some one help me?
Thanks in advance
Maithili
Maithili
|
|
|
|
|
Maithili
In addition to adding the MFC header files, you will also need to link with the MFC DLLs either statically or dynamically.
Nish
I am the Keyboard Smasher
|
|
|
|
|
Hi Nish,
Thanks for your reply.
But if you are referring to the project settings/general/MFC classes
then, I have already chosen 'Use MFC in a static Library' option.
Should'nt that be enough? I still get the compilation errors.
Thanks
Maithili
|
|
|
|
|
Mythili wrote:
I have already chosen 'Use MFC in a static Library' option.
Should'nt that be enough?
Yes, that should do.
You are getting compile errors eh?
Can you show your stdafx.h please?
And I presume you have included it in all your cpp files.
Nish
I am the Keyboard Smasher
|
|
|
|
|
Perhaps post the actual error you are receiving.
Compilation error...? I don't think that has anything to do with including the right libs/dll's. The compiler goes blitz when your code is funny...like your using a structure that doesn't exist.
You have all the right includes...?
"An expert is someone who has made all the mistakes in his or her field" - Niels Bohr
|
|
|
|
|
Hi,
I am using visual studio installer 1.1 and I would like to create a sreen that would allow the user to select the features that he wishes to install, a bit like in office 2k/xp. Please help me as this is of urgent matter.
JS Paquet.
// JS Paquet
cout << "Thank you all" << endl;
|
|
|
|
|
Is there a standard way in MFC to track the state of Scroll Lock, Num Lock
and Caps Lock?
Thomas George
modified 29-Aug-18 21:01pm.
|
|
|
|
|
Hmmm... try the Win32 GetKeyboardState call?
|
|
|
|
|
But, what is the event on which I call it?
modified 29-Aug-18 21:01pm.
|
|
|
|
|
If the user presses the key while you have the keyboard focus, you will get a WM_KEYDOWN and a WM_KEYUP message for those three keys.
If you want to know the state of the keys to display in your status bar like a lot of program sdo, then just call GetKeyState in your handler that updates your user interface.
|
|
|
|
|
I have to update the state, even when I do not have keyboard focus. (like the status bar does)
Thomas
modified 29-Aug-18 21:01pm.
|
|
|
|
|
Then you need to use a timer.
Christian
The tragedy of cyberspace - that so much can travel so far, and yet mean so little.
"I'm somewhat suspicious of STL though. My (test,experimental) program worked first time. Whats that all about??!?!
- Jon Hulatt, 22/3/2002
|
|
|
|
|
If you want to display the state info on the Status Bar you'd do this in your CMainFrame::OnUpdateStatusBar() or am I missing something here?
Neville Franks, Author of ED for Windows. www.getsoft.com
|
|
|
|