|
Hi
derive class from Crecordset using class wizard. (Ctrl+W)
In process it will ask you database path and table name.
Give the table name and then it will show all the attributes from table as its members list.
assign name to member
Implement or use Database open and close calls
Better to start is some of the tutorials from either codeguru or codeproject
Hope this will help
Remember
Ms-Access - database limit -- 2GB
Best of luck
Leave your mark wherever you go
|
|
|
|
|
You'll probably get more replies, if you asked specific technical questions. Your message is very vague.
However there are a few methods for accessing MS Access from MFC. Personally I prefer using ADO rather than the MFC classes Database/Recordset classes.
Plenty of examples here[^]
Michael
CP Blog [^]
|
|
|
|
|
Get a copy of Mike Blazcaks excellent book on MFC. It has some very nice samples. BTW the VC IDE can create a skeleton app for you quite easily.
|
|
|
|
|
Hello everyone,
How can i link between my application(thaT I WROTE IN C++) and my MFC application,i mean i want to run my application by pressing START button in my MFC project
If any one can help ill be gratefull,
Thank you ,
Johnny
|
|
|
|
|
One way is
OnStartButton()
{
system(path to your_C++_app.exe);
}
|
|
|
|
|
Thank you!
But what if the path can vary?
Johnny
|
|
|
|
|
i think ShellExe( .....) will help u ,,, use "Open" for this.
|
|
|
|
|
The preferred method is to use CreateProcess() or ShellExecute() . The system() function is a hold-over from Unix.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
Hi,
I've got a mixed source code project (ADA, C and C++) which I need to compile using a makefile (linking will be done at the ada side). For the C++ and C code I'm using the Visual C++ 6.0 compiler and I run vcvars32 beforehand to ensure that the compiler options are setup. However, the problem I'm having is that when I #include any 'system' header files, e.g. fstream.h, stdio, etc... I get an error saying it can't find the specified file. I've tried including a hardcoded path in my make file to these files but I still get the same error!
Does anyone know how I can get my makefile to (preferably automatically) pick up these files?
Also sometimes when I reboot my machine the makefile tries to use the g++3 compiler instead of the studio one, what might be causing this? (I'm using VC 6.0 compiler in other parts of the project so I'm trying to keep the number of compilers, languages and libraries down to a minimum)
many thanks,
|
|
|
|
|
Hi all
i need to include the library "afxdao.h" with
my app, but when i compile i get the following error
has any one come across this before ?
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\dbdaoint.h(109): error C2011: 'LockTypeEnum' : 'enum' type redefinition
c:\MyApp\Debug\msado15.tlh(228) : see declaration of 'LockTypeEnum'
|
|
|
|
|
First, the linker does not care about .h files. Those files are handled by the preprocessor.
si_69 wrote:
i need to include the library "afxdao.h"...
This is a header file, not a library.
si_69 wrote:
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\dbdaoint.h(109): error C2011: 'LockTypeEnum' : 'enum' type redefinition
c:\MyApp\Debug\msado15.tlh(228) : see declaration of 'LockTypeEnum'
The error is telling you that more than once instance of LockTypeEnum has been found. If you remove the inclusion of afxdao.h , does the error go away, or get replaced with a different error?
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
DavidCrow wrote:
If you remove the inclusion of afxdao.h, does the error go away, or get replaced with a different error?
yes, the error goes away if i remove the afxdao.h
but i require that header file
i found using
#import "C:\program files\common files\system\ado\msado15.dll" no_namespace rename( "EOF", "adoEOF" ) rename ("LockTypeEnum","newLockTypeEnum")
has solved my problem
thanks anyway
si
|
|
|
|
|
si_69 wrote:
i found using
#import "C:\program files\common files\system\ado\msado15.dll" no_namespace rename( "EOF", "adoEOF" ) rename ("LockTypeEnum","newLockTypeEnum")
has solved my problem
It may very well have solved it, but without knowing more about the application and the problem, it may also have just masked the real problem.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
My app creates a CDialog which is displayed in the taskbar. Then I hide this dialog (with ShowWindow(SW_HIDE)) and create a new CDialog. However since I hid the 1st dialog, the taskbar window is also not shown and the new CDialog doesn't display a new taskbar window. What am I doing wrong here? - how can the new dialog display a taskbar window?
|
|
|
|
|
in my application i need to find the windows system directory(ie. say C:\WINNT\system32) at run time. how do i do so? any APIs?
|
|
|
|
|
TCHAR buffer[_MAX_PATH+1] = { 0 };
BOOL ok = SHGetSpecialFolderPath(myHwnd, buffer, CSIDL_SYSTEM, false);
we are here to help each other get through this thing, whatever it is Vonnegut jr.
sighist || Agile Programming | doxygen
|
|
|
|
|
SHGetSpecialFolderPath not working......
|
|
|
|
|
GetSystemDirectory
sometimes it's soooo easy.
modified 12-Sep-18 21:01pm.
|
|
|
|
|
CSDIL_SYSTEM does not exist.
i have checked the other option, none gives the systen folder
|
|
|
|
|
Anonymous wrote:
CSDIL_SYSTEM does not exist.
i have checked the other option, none gives the systen folder
CSIDL_SYSTEM is the correct value. It is defined in shlobj.h
You might also try GetSystemDirectory but I'm not sure if that returns System or System32.
Michael
CP Blog [^]
|
|
|
|
|
It's CSIDL_SYSTEM, and it does exist with the current platform SDK.
If you're running VC6 "out of the box", you might have to use GetSystemDirectory()
we are here to help each other get through this thing, whatever it is Vonnegut jr.
sighist || Agile Programming | doxygen
|
|
|
|
|
#include <strstrea.h>
char szDir[128];
ostrstream strmDir(szDir, sizeof(szDir));
strmDir << getenv("SystemRoot");
strmDir << "\\System32" << ends;
You can string the insertions out in one line. I broke them up into seperate lines because of the horixzontal linitation of this window.
The size of 128 is arbitrary. You could use "MAX_PATH" or "_MAX_PATH" depending on other includes in your program
|
|
|
|
|
Anonymous wrote:
strmDir << getenv("SystemRoot");
Not only does this rely upon environment variables, which I consider a bad practice, it does not include "System" or "System32" in the returned value.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
GetSystemDirectory[^]?
"It was when I found out I could make mistakes that I knew I was on to something."
-Ornette Coleman
"Philosophy is a study that lets us be unhappy more intelligently."
-Anon.
|
|
|
|
|
The include in the previous response should have been strstrea.h
|
|
|
|