Solved

C++ - how to use ODBC text driver ?

Posted on 1998-09-21
3
311 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 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

Secure Your Active Directory - April 20, 2017

Active Directory plays a critical role in your company’s IT infrastructure and keeping it secure in today’s hacker-infested world is a must.
Microsoft published 300+ pages of guidance, but who has the time, money, and resources to implement? Register now to find an easier way.

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…
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 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…

730 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