Link to home
Start Free TrialLog in
Avatar of Brian Mulder
Brian MulderFlag for Netherlands

asked on

How to circumvent the message "could not find installable ISAM"

Hello All,

Been looking at this since friday and accepted it for a fact but would like to solve my problem.

I have a small project that reads a csv file like

---------
field1;field2;field3;field4;
myname here;anothername ;and anotherone;the last one;
myname here;anothername ;and anotherone;the last one;
myname here;anothername ;and anotherone;the last one;
myname here;anothername ;and anotherone;the last one;
---------

and some code that reads the CSV into a Dataset like

---------
    Private Function GetCSVFile(ByVal pathName As String, ByVal fileName As String) As DataSet
        Dim CSVConnection As OleDb.OleDbConnection = New OleDb.OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & pathName & ";Extended Properties=Text;")
        Dim CSVCommand As OleDb.OleDbCommand = New OleDb.OleDbCommand("SELECT * FROM " & fileName, CSVConnection)
        Dim CSVAdapter As OleDb.OleDbDataAdapter = New OleDb.OleDbDataAdapter(CSVCommand)

        CSVConnection.Open()
        Dim CSVDataSet As DataSet = New DataSet()
        CSVAdapter.Fill(CSVDataSet)
        CSVConnection.Close()
        Return CSVDataSet
    End Function
---------

That works except when you need to add some more extended properties like HDR=YES; etc.... I know i'm missing something but what?

Whatever i try, like quotes or double quotes or same line or anything else it does not work, so i leave this question open until someone posts a working piece of code in VB or C# doesn't matter as long as it works for loading a textfile into a dataset and being able to add more extended properties then Extended Properties=Text;

thanks a bunch
Brian
ASKER CERTIFIED SOLUTION
Avatar of iboutchkine
iboutchkine

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Brian Mulder

ASKER

thanks for that note, i found the file and in the registry on the same path so following up
i need to be at home to put in the disc doing the install / repair of office
found the correct string finally here
source: http://www.thescripts.com/forum/thread387079.html

so my string becomes
Dim CSVConnection As OleDb.OleDbConnection = New OleDb.OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & pathName & ";Extended Properties=""Text;HDR=Yes;FMT=Delimited""")

which works

thanks for your interest