Solved

C++ - how to use ODBC text driver ?

Posted on 1998-09-21
3
306 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
ID: 1173276
Gregory,
So you want to write code that accesses a text table from VC 5?
0
 

Author Comment

by:Gregory_seifert
ID: 1173277
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
ID: 1173278
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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Written by John Humphreys C++ Threading and the POSIX Library This article will cover the basic information that you need to know in order to make use of the POSIX threading library available for C and C++ on UNIX and most Linux systems.   [s…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
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 viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.

856 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