?
Solved

C++ - how to use ODBC text driver ?

Posted on 1998-09-21
3
Medium Priority
?
324 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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 100 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

When writing generic code, using template meta-programming techniques, it is sometimes useful to know if a type is convertible to another type. A good example of when this might be is if you are writing diagnostic instrumentation for code to generat…
  Included as part of the C++ Standard Template Library (STL) is a collection of generic containers. Each of these containers serves a different purpose and has different pros and cons. It is often difficult to decide which container to use and …
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

770 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