Click here to Skip to main content
15,909,737 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralBoost and VC++6sp5 Pin
Dan Watt17-Jul-02 18:41
Dan Watt17-Jul-02 18:41 
GeneralEnumProcesss Pin
gekoscan17-Jul-02 17:38
gekoscan17-Jul-02 17:38 
GeneralRe: EnumProcesss Pin
Scot Brennecke17-Jul-02 18:55
professionalScot Brennecke17-Jul-02 18:55 
GeneralStrange problem Pin
Anonymous17-Jul-02 17:31
Anonymous17-Jul-02 17:31 
GeneralRe: Strange problem Pin
Christian Graus17-Jul-02 18:11
protectorChristian Graus17-Jul-02 18:11 
Generalwinsock or CSocket Pin
zecodela17-Jul-02 17:22
zecodela17-Jul-02 17:22 
GeneralRe: winsock or CSocket Pin
Greven17-Jul-02 17:57
Greven17-Jul-02 17:57 
GeneralRe: winsock or CSocket Pin
Masaaki Onishi18-Jul-02 6:14
Masaaki Onishi18-Jul-02 6:14 
GeneralRe: winsock or CSocket Pin
zecodela20-Jul-02 2:55
zecodela20-Jul-02 2:55 
GeneralNull'ing structures Pin
Marc Richarme17-Jul-02 17:18
Marc Richarme17-Jul-02 17:18 
GeneralRe: Null'ing structures Pin
gekoscan17-Jul-02 17:43
gekoscan17-Jul-02 17:43 
GeneralRe: Null'ing structures Pin
Scot Brennecke17-Jul-02 19:04
professionalScot Brennecke17-Jul-02 19:04 
GeneralRe: Null'ing structures Pin
Marc Richarme17-Jul-02 20:12
Marc Richarme17-Jul-02 20:12 
GeneralRe: Null'ing structures Pin
Scot Brennecke17-Jul-02 20:34
professionalScot Brennecke17-Jul-02 20:34 
GeneralRe: Null'ing structures Pin
Marc Richarme20-Jul-02 6:17
Marc Richarme20-Jul-02 6:17 
QuestionWhy does windows database programming have to be so hard? Pin
Anonymous17-Jul-02 13:14
Anonymous17-Jul-02 13:14 
AnswerRe: Why does windows database programming have to be so hard? Pin
Matt Gullett17-Jul-02 13:53
Matt Gullett17-Jul-02 13:53 
Windows provides lots of way to get to data in databases but as you point out many of them are complex at least in the form provided by the system. I have used the CDatabase/CRecordset/CDaoDatabase, CDaoRecordset stuff from MFC, the ODBC api in straight C, ADO via smart pointers, ADO via straight COM, etc.

All of these do what you want but none with quite so few lines of code. I think they are designed to be more generic and powerful, but unfortunantely for many tasks they are just a pain in the butt.

I would take a look at the ADO library by Carlos Antollini (http://www.codeproject.com/database/caaadoclass1.asp). I have not used them myself but they appear to be quite simple and powerful.

If that doesn't work for you I have a set of class wrappers for ADO I developed a couple years ago which can do what you ask in fewer lines of code than you listed. I have not posted it here because it is not UNICODE compliant. Let me know if you would like the library and I will sent it to you with source code. It does not require MFC and this is basically how you would do what you asked:


CFPSADODatabase db("db", "uid", "pwd");
CFPSADORecordset rs(strSQL, db);

while (!rs.IsEOF())
{
   for (iField = 0; iField < rs.GetFieldCount(); iField++)
      printf(rs.GetFieldValueText(iField));
   rs.MoveNext();
}

GeneralWinsock Pin
Ken Mazaika17-Jul-02 13:08
Ken Mazaika17-Jul-02 13:08 
GeneralRe: Winsock Pin
Nish Nishant17-Jul-02 15:24
sitebuilderNish Nishant17-Jul-02 15:24 
GeneralRe: Winsock Pin
Masaaki Onishi18-Jul-02 6:18
Masaaki Onishi18-Jul-02 6:18 
GeneralDebugging help reqd. Pin
User 988517-Jul-02 12:18
User 988517-Jul-02 12:18 
GeneralRe: Debugging help reqd. Pin
Chris Losinger17-Jul-02 12:43
professionalChris Losinger17-Jul-02 12:43 
GeneralRe: Debugging help reqd. Pin
benjymous18-Jul-02 0:48
benjymous18-Jul-02 0:48 
GeneralASSERT and Windows XP Problem Pin
Justin Cooke17-Jul-02 11:23
Justin Cooke17-Jul-02 11:23 
GeneralRe: ASSERT and Windows XP Problem Pin
Bugra Barin17-Jul-02 13:40
Bugra Barin17-Jul-02 13:40 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.