471,594 Members | 1,578 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,594 software developers and data experts.

Problem in Reading TEXT files using OLEDB


I have got a strange problem. May I know any solution for this.

Here is the detailed description about the problem
We have got a mainframe system and also production and development

There was an application in the production server since 3 years and was
working fine. Recenlty we got into stucked up with this problem. Every
night the mainframe generates few text files and thru FTP it sents
those files to production server.

In the production server application we do have got few jobs (i.e
dotnet application) that reads this text file(s) and the data from
these text files will be stored in our sql server DB for the use of web

Now the jobs in the development server (which we are using for testing)
got creating problems like "Invalid index" and stoping the process
further. After examining the problem in respective dotnet application i
got to know the problem where it is but I am surprised to see that the
same application working fine in production server since few years.

I dont have the source code of dotnet application which is running in
the production server. But I do have source code of dot net application
that is in development server.

Here in the dot net application I am able to see the source code and it
is being written like this...the algorithm as follows.

1. Dynamically getting the connection string (i.e.
Provider=Microsoft.jet.oledb.4.0;Data source=C:\myapp;Extended
2. Establishing oledb connection.
3. Dynamically constructing the SELECT stmt with respective txt file ex
"select * from members.txt" (here the members.txt file is from Mainframe
and stored in C:\myapp folder)
4. Using OLEDB Command object executing the about SELECT statement and
returning back to OLEDBDataReader object back to the caller.
5. In the caller function the person who written the code directly
referring values from the reader as objReader.getvalue(0),
objReader.getvalue(1)... so on.
6. Now the problem is after executing the command object in the reader
I am able to see only one column i.e objReader.getvalue(0). Its
the entire one line of the text file is coming in one column (but it
suppose to split in to multiple columns)
7. Its generating an exception when the code refers second column on
8. Here I donno wat is the delimeter for knowing columns in the text
9. I do see few spaces between values in the text files.
10. Here my doubt is if the code is compiled like this how its running
fine in the production server.
11. Or if I wann change code in the development server how could I do
that. After I seached in internet in the while generating the
connection string in the extended properties I have to mention lie

"Extended Properties=Text;HDR=No;delimited=TabDelimited" This is in
case of the text file content was delimited by tab

Where as here I am thinking that its not delimited by TAB and also
thinking that it might be delimited by no of characters example.. first
column is 15 characters and from 16th character on wards its second
column until 25th character etc.... in this case how and wat value
should I mention in the delimited property?

can any one of you enlighten me on this.

I am desperately looking for valuable suggestions.
Thanks in advance...

svijay's Profile: http://www.hightechtalks.com/m628
View this thread: http://www.hightechtalks.com/t2319718

Dec 30 '05 #1
1 2231


I got the solution I must use schema.ini file to solve this and I need
to define the column definitions in that file.

thx to all of U
svijay's Profile: http://www.hightechtalks.com/m628
View this thread: http://www.hightechtalks.com/t2319718

Dec 30 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by MadCrazyNewbie | last post: by
5 posts views Thread by Jesse Albert | last post: by
6 posts views Thread by Bill Nguyen | last post: by
reply views Thread by XIAOLAOHU | last post: by
reply views Thread by leo001 | last post: by
reply views Thread by Anwar ali | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.