Click here to Skip to main content
15,899,314 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Generaldisable resize Pin
Guy13-Aug-00 14:19
Guy13-Aug-00 14:19 
GeneralRe: disable resize Pin
Remus Lazar14-Aug-00 3:16
Remus Lazar14-Aug-00 3:16 
GeneralRe: disable resize Pin
Guy14-Aug-00 8:30
Guy14-Aug-00 8:30 
GeneralRe: disable resize Pin
Mike Dunn14-Aug-00 7:34
Mike Dunn14-Aug-00 7:34 
Generalthank you Remus and Mike Pin
Guy15-Aug-00 5:08
Guy15-Aug-00 5:08 
GeneralGetting Mouse clicks Pin
Member 442613-Aug-00 7:02
Member 442613-Aug-00 7:02 
GeneralRe: Getting Mouse clicks Pin
Paolo Messina13-Aug-00 10:25
professionalPaolo Messina13-Aug-00 10:25 
GeneralReading TEXT files Pin
Steve Lai13-Aug-00 6:41
Steve Lai13-Aug-00 6:41 
Hi Everyone,

I'm using Visual C++6 and have this problem and hope you can help me out!
What I'm trying to do is to read data from a TEXT FILE and plug the values into a CString, which will be used as a SQL statement.

For example, let's say I have the follwing data in a TEXT FILE:
(the format used for the TEXT File is that the fist row
will be the tablename, and then the following rows will
be the field names and its attributes, and the field
names and attributes will be separated by a comma)

CustomerName
CustID, INTEGER
FirstName, STRING
LastName, STRING
etc...

How can I read the values from the TEXT FILE one by one so at the end, I'll come up with a statement such as:

SQL= "CREATE TABLE CustomerName(CustID INTEGER, FirstName STRING, LastName STRING, etc...)"

I would like to put the reading of the values from the TEXT FILE into a loop so that no matter how many FIELDS the text files contain, the loop will be able to handle it and put all the values into a SQL statment.

For example, if I have the following int the TEXT FILE:
(3 FILEDS and 3 VALUES OF THE FIELD)

CustomerName
CustID, INTEGER
FirstName, STRING
LastName, STRING

Then the following would occur:
SQL="CREATE TABLE CustomerName(CustID INTEGER, FirstName
STRING, LastName STRING)"

BUT if I only have 1 FIELD AND VALUE:

CustomerName
CustID, INTEGER

The reading of the TEXT FILE will be dynamic and the SQL would be:

SQL="CREATE TABLE CustomerName(ID INTEGER)"

Hope you can understand what I'm trying to do.
I've tried to do it in a loop myself but I had some trouble, so If anyone has any solutions, PLMK! Thanks!

Steve

GeneralRe: Reading TEXT files Pin
wanderley16-Aug-00 15:15
wanderley16-Aug-00 15:15 
GeneralI need .ICO and .ICL specs! Pin
Eto12-Aug-00 21:38
Eto12-Aug-00 21:38 
QuestionCan I add icons to the systray Pin
Leon Su12-Aug-00 15:50
sussLeon Su12-Aug-00 15:50 
Generaltoolbar within Splitter view Pin
Ivan Polak12-Aug-00 9:04
Ivan Polak12-Aug-00 9:04 
QuestionMultimedia real-time sound? Pin
mrcoder11-Aug-00 14:29
mrcoder11-Aug-00 14:29 
GeneralControl Panel..... Pin
Carlo Comino11-Aug-00 10:29
sussCarlo Comino11-Aug-00 10:29 
GeneralRe: Control Panel..... Pin
Mike Dunn11-Aug-00 18:59
Mike Dunn11-Aug-00 18:59 
GeneralOnAfterPrint for VC++ Pin
Derek Lakin11-Aug-00 5:39
Derek Lakin11-Aug-00 5:39 
GeneralString sorting Pin
Erik Hammar11-Aug-00 2:36
Erik Hammar11-Aug-00 2:36 
GeneralRe: String sorting Pin
Tim Deveaux12-Aug-00 5:25
Tim Deveaux12-Aug-00 5:25 
Generalclosing dialog by pressing anywhere outside the dialog Pin
Mikko Mononen11-Aug-00 0:02
Mikko Mononen11-Aug-00 0:02 
GeneralRe: closing dialog by pressing anywhere outside the dialog Pin
warjo11-Aug-00 0:32
warjo11-Aug-00 0:32 
QuestionAdding toolbar buttons to MSOL and MSIE?? Pin
warjo10-Aug-00 21:56
warjo10-Aug-00 21:56 
Generalvisual studio Pin
koteswara10-Aug-00 20:42
koteswara10-Aug-00 20:42 
GeneralRe: visual studio Pin
Mike Melnikov11-Aug-00 6:53
Mike Melnikov11-Aug-00 6:53 
GeneralRe: visual studio Pin
David Wulff11-Aug-00 14:54
David Wulff11-Aug-00 14:54 
QuestionHow to get a CString to contain the contents of IHTMLDocument2::toString(...) Pin
David Wulff10-Aug-00 9:27
David Wulff10-Aug-00 9:27 

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.