473,238 Members | 1,582 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

Problem in Reading TEXT files using OLEDB


hi

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
server.

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
applications.

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
Properties=Text;)
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
because
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
wards.
8. Here I donno wat is the delimeter for knowing columns in the text
file.
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
this..

"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...

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

Dec 30 '05 #1
1 2367

Hi

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
------------------------------------------------------------------------
svijay's Profile: http://www.hightechtalks.com/m628
View this thread: http://www.hightechtalks.com/t2319718

Dec 30 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Roland Hall | last post by:
I have two(2) issues. I'm experiencing a little difficulty and having to resort to a work around. I already found one bug, although stated the bug was only in ODBC, which I'm not using. It...
14
by: Roland Hall | last post by:
I have two(2) issues. I'm experiencing a little difficulty and having to resort to a work around. I already found one bug, although stated the bug was only in ODBC, which I'm not using. It...
3
by: Roland Hall | last post by:
Three times the charm? Sorry for the repost. Trying to get my account right. I have two(2) issues. I'm experiencing a little difficulty and having to resort to a work around. I already...
2
by: MadCrazyNewbie | last post by:
Hey Group, Sorry to be a pain yet again. I problem that i don`t know how to get around:( I use the following connection class on my project: Private Shared mConnectionsstring As String =...
8
by: stephane8 | last post by:
I'm able to open and read my .csv file. But when the character "-" is in one of my fields (ex : 18802-002) I get a system.DBNull value ! Even if I edit the file with notepad and put "18802-002" I...
5
by: Jesse Albert | last post by:
Hiyo, I'm trying to import a CSV file into a datatable using either ODBC or OLEDB. One of the columns contains an IP Address. For some reason, the IP address will not display correctly. All of...
2
by: DC | last post by:
The Code <%@ import namespace="System" %> <%@ import namespace="System.Web" %> <%@ import namespace="System.Web.UI" %> <%@ import namespace="System.Web.UI.HtmlControls" %> <%@ import...
6
by: Bill Nguyen | last post by:
I'm reading a CSV file with the date colum formatted as "YYMMDD" -"070310" when viewed in notepad or similar trext editor. However, in my app, using ODBCReader, the column value becomes "70310"...
6
by: =?Utf-8?B?UmljaA==?= | last post by:
'--this code works but only reads text into one column when contains multiple cols Dim ds1x As New DataSet Dim ConStr As String = _ "Provider=Microsoft.Jet.OLEDB.4.0;Data...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
0
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...

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.