By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
432,474 Members | 939 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 432,474 IT Pros & Developers. It's quick & easy.

Column Names with Embedded Spaces with the Text Driver

P: n/a
I am trying to use the Microsoft Text Driver to access data in a text
file via ODBC calls. Everything has worked fine so far. I am now trying
to implement support for a file that has a special column name line as
the first line. A monkey wrench thrown in is that one column must
contain a mix of numbers and values that are an actual valid date. The
main reason to use a schema.ini is when you do not have this column
name line and you need to assign names to the input columns. But if I
do not specifiy the column data types in the schema.ini and the first
few rows contain dates, the datatype is then assumed to be date. And
when it hits a non-date value the code blows up. So I am specifying the
column names and datatypes using the column names in the first line of
the file and setting all columns to Text. But now, when I try to
reference a field in the input stream with code like this:

dim fieldname as string = "Dist No"

filereader(fieldname).tostring

Apparently it doesn't like the value of the field name to contain
spaces. I know I can reference the data with:

filereader("Dist No").tostring

That works fine, but I need to get the field name from a variable.

Is there anyway to do what I need to do?

Dec 13 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.