Connecting to CSV Files

Connecting to CSV Files

The SaveToDB add-in allows you to connect to CSV files using two wizards:

This section covers the first method, which utilizes OLEDB providers and ODBC drivers.

The SaveToDB add-in supports the following data providers:

Below is a sample of the Database Connection Wizard page where you can select the data provider:

Connecting Excel to CSV - Select Provider

In the next step, choose a folder (or a file):

Connecting Excel to CSV - Select Folder

You can click the Properties button to edit the connection properties.

Next, select a CSV file to connect:

Connecting Excel to CSV - Select File

Microsoft CSV data providers require a schema.ini file in the same folder as the source file. The file should define the structure like this:

[MsnMoneyQuotes.csv]
ColNameHeader=True
Format=Delimited(;)
MaxScanRows=100
CharacterSet=ANSI
Col1=LoadDate DateTime(yyyy-MM-dd)
Col2=LoadTime DateTime
Col3=MarketDate DateTime(yyyy-MM-dd)
Col4=MarketTime DateTime
Col5=Symbol Text
Col6=MsnSymbol Text
Col7=Bid Double
Col8=Ask Double
Col9=BidSize Integer
Col10=AskSize Integer
Col11=Open Double
Col12=High Double
Col13=Low Double
Col14=Last Double
Col15=Volume Integer

The SaveToDB add-in generates these definitions for you by analyzing the file contents.

You can manually adjust the generated definitions. For more details, refer to https://learn.microsoft.com/en-us/sql/odbc/microsoft/schema-ini-file-text-file-driver?view=sql-server-2017.

For files encoded in UTF-8, use the following value:

CharacterSet=65001

This website is using cookies. By continuing to browse, you give us your consent to our use of cookies as explained in our Cookie Policy.