Solved

C++ - how to use ODBC text driver ?

Posted on 1998-09-21
3
292 Views
Last Modified: 2009-07-29
I want to use the ODBC text driver from out VC++ 5. Where can I find any documentation about this or how to do it ? I have full knowledge of the use of other ODBC drivers so my problem is related only to the textdriver !
0
Comment
Question by:Gregory_seifert
3 Comments
 

Expert Comment

by:tommyq
Comment Utility
Gregory,
So you want to write code that accesses a text table from VC 5?
0
 

Author Comment

by:Gregory_seifert
Comment Utility
It will be clear that my question doesn't mean I don't know how to access text files fromout Visual C++.

The problem is I want to use the Cristal Reports tools fromout visual C++ to generate reports from text files. Normally generating full printable documents in Visual C++ is a time consuming task. However if I know how to use the ODBC textdriver I can pass through this task towards Cristal reports. I already know you have to use the ODBC administrator (or directly and updating the registry) to create a params.INI file. However I don't succeed to access files through the CRecordSet class. When calling CRecordSet::Open I receive a messagebox with "error in FROM clause"
0
 
LVL 1

Accepted Solution

by:
msa092298 earned 50 total points
Comment Utility
The problem is how the ODBC text driver interprets the file. I faced the same problem.
The first (and only the first) line of the file is considered to be a comma separated list of field names.  The remaining lines are considered to be comma separated list of data values. If the number of values in any one line exceeds the number of field names at the first line, the driver generates field names like field1, field2 ...  You should choose field names in the first line that cause no problems for crystal reports (no space characters, etc..).
ex. for a text file

<file starts here>ID,Name,Address
1,my name,my address
2,your name,your address
3,his name,his address.<file ends here>
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Templates For Beginners Or How To Encourage The Compiler To Work For You Introduction This tutorial is targeted at the reader who is, perhaps, familiar with the basics of C++ but would prefer a little slower introduction to the more ad…
Many modern programming languages support the concept of a property -- a class member that combines characteristics of both a data member and a method.  These are sometimes called "smart fields" because you can add logic that is applied automaticall…
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now