Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Visual C++ -> SQL Statement -> Access DB / How to ??

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
Hi everybody,

I've got a little problem.
I'm writing a program with Visual C++ 6.0 ( with MFC - MDI ) wich should add new Data to an Access database ( ODBC - Snapshot ).
My Problem: I'd like to add and delete data by a SQL statement wich contains variables like CString e.g. for the data. ( The data comes from a Dialog defined in the Doc Class )

Can anybody out there tell me, how to send the SQL command for example from my Doc Class ???

Thanx,
SAM
 
Is it that you are having problems piecing your SQL statement together with the data in the variables so you can execute the statement?

Niky Williams
Lead Engineer
NTS Marketing, Inc.
 
Hi, my problem is to find a VC++ command to send the SQL statement and how to use this command.

Thanks SAM
 
You probably want to use either CDatabase::ExecuteSQL or CDaoDatabase::Execute. For info on these functions, try the following two links.

CDatabase:

CDaoDatabase:


Also, Microsoft has a few MFC database samples available. To find them, go to


On the left, select "Code Examples". Then pick "Visual Tools and Languages". Then "Visual C++". Then "Microsoft Foundation Classes". Then just browse the list and try to pick out something that might help.
 
That's what I was looking for !
Thank's a lot and greetings from germany,
SAM
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top