Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6005367
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T01:23:14+00:00 2026-05-23T01:23:14+00:00

Apparently I’m missing something while trying to use a schema.ini to define a csv.

  • 0

Apparently I’m missing something while trying to use a schema.ini to define a csv. My code seems to ignore the schema.ini.

The schema.ini is placed in the same subdir as the csv and is as follows:

[excel.csv]
Format = CSVDelimited

Col1=TSP text width 17
Col2=Svc text width 17
Col3=DTM text width 3

The csv data which consists of a ‘heading’ row and a ‘data’ row is as follows:

"TSP","Svc","DTM"

"006958581","006927792","rdt"

The code I’m attempting to use is as follows:

Imports System.Data.OleDb
Module Module1
Sub Main()

Dim Csv_in_name As String = "excel.csv"
Dim Csv_in_path As String =
        "C:\Documents and Settings\Administrator\My Documents" + _
        "\Visual Studio 2008\Projects\csv_reader\csv_reader\bin\Debug"
Dim cn As New OleDbConnection
Dim adapter As New OleDbDataAdapter
Dim cmd As New OleDbCommand
Dim dtset As New DataSet
Dim dt As New DataTable
Dim cnstr As String =
        "Provider=Microsoft.Jet.OLEDB.4.0;" + "Data source = " + _
        Csv_in_path + "\; Extended Properties=""Text;HDR=No;FMT=Delimited"""

cn.ConnectionString = cnstr
cn.Open()

cmd.Connection = cn
cmd.CommandText = "Select * from " + Csv_in_name

adapter.SelectCommand = cmd
adapter.Fill(dtset, "MyTable")

dt = dtset.Tables("MyTable")
cn.Close()
dt.WriteXml(Csv_in_path + "\data.xml")

End Sub
End Module

When HDR=No in the connection string, the code seems to ignore schema.ini as evidenced by the field delimiter names. Both rows are interpreted as data and the XML data is as follows:

<?xml version="1.0" standalone="yes" ?>
<NewDataSet>
  <MyTable>
    <F1>TSP</F1>
    <F2>Svc</F2>
    <F3>DTM</F3>
  </MyTable>
  <MyTable>
    <F1>006958581</F1>
    <F2>006927792</F2>
    <F3>rdt</F3>
  </MyTable>
</NewDataSet>

When HDR=Yes, schema.ini is ignored as expected and the fields are properly labeled via the first row in the csv. The XML data is as follows:

<?xml version="1.0" standalone="yes" ?>
<NewDataSet>
  <MyTable>
    <TSP>006958581</TSP>
    <Svc>006927792</Svc>
    <DTM>rdt</DTM>
  </MyTable>
</NewDataSet> 

Since the schema.ini is present in both instances, I would have expected 2 rows of data in the first instance but with the same field delimiters as in the second instance since these are the definitions in schema.ini. Why is schema.ini being ignored?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T01:23:15+00:00Added an answer on May 23, 2026 at 1:23 am

    Change it to HDR=No.

    HDR stands for Column Header.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Apparently, I'm missing something fundamental. I'm having a problem with formatting the value of
Apparently I'm missing something obvious here, but would appreciate a quick example. I've got
Apparently we use the Scrum development methodology. Here's generally how it goes: Developers thrash
Apparently .NET 4.0 does not have the PartCreator/ExportFactory for non-SL. Which is something I
Apparently I do not need a 'Maps API key' to use the 'Google Geocoding
Apparently I've done something I'm not aware of All my classes now have warnings
Apparently there is no predefined list available in .net. I'd like to use a
Apparently I don't understand something about binding ListBox controls to data. Here is a
Apparently, this code gives me error at the last line cvCvtColor(), what is wrong?
Apparently, a lot of ORMs do something like this: query.filter(username == bob) to generate

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.