nabeels786
Mar 30th, 2002, 03:13 PM
can i connect with a db and manipulate it with sql?
nabeels786
Mar 31st, 2002, 10:11 AM
Doesn't have to be SQL
I've been looking around for tutorials, I couldn't find any
CornedBee
Apr 2nd, 2002, 12:42 PM
You can use DAO, but it is very hard and poorly documented without MFC.
The core thing are the headers dbdaoint.h and dbdaoerr.h. Those define the front-end of the DAO COM objects. The DAO documentation itself was written for VBA.
I attach some files I've written that can show you everything to get a basic DAO app working. But I warn you: they are a mess and use some classes I have created myself.
The most relevant files are database.h/cpp (the database handling class), stdhdr.h (includes all headers necessary, especially tcpp.h, objbase.h, comdef.h, dbdaoint.h, daogetrw.h, dbdaoid.h and dbdaoerr.h).
tcpp is a header I wrote myself. It gives you a UNICODE-generic version of the iostream library.
objbase is the main header for ALL apps that use COM.
comdef exists only in VC++, it defines the classes _variant_t and _bstr_t, which are very useful when dealing with COM.
dbdaoint defines the DAO COM interfaces.
daogetrw are some additional structs and interfaces
dbdaoid defines the GUIDs for DAO
dbdaoerr defines DAO's error codes
Another tip: use only the W versions of the interfaces and only UNICODE strings.