Hello Group,
I am trying to import data in a .csv file - the data contains English
pound signs (£). When importing data via filestreams etc I use the
"Default" code page - which is 1252 (ISO 8859-1). However I can see no
way to make the import of my csv file aware of this in the following
scenario, and the imported data contains character strings instead of
pound signs.
Can anyone help?
sPath = finputFile.Dire ctoryName
ExcelConnection = New
OleDb.OleDbConn ection("Provide r=Microsoft.Jet .OLEDB.4.0;Data Source= "
+ sPath + ";Extended Properties='tex t;HDR=Yes;FMT=D elimited;IMEX=1 ;'")
Try
Using ExcelCommand As New OleDb.OleDbComm and("SELECT *
FROM " + finputFile.Name , ExcelConnection )
Using ExcelAdapter As New
OleDb.OleDbData Adapter((ExcelC ommand)
ExcelConnection .Open()
Using ExcelDataSet As New DataSet()
ExcelAdapter.Fi ll(ExcelDataSet , "Supplier")
'// Create the XML file
oXMLDoc = New XmlDocument
oXMLDoc.Preserv eWhitespace = True
oXMLDoc.LoadXml (ExcelDataSet.G etXml())
oXMLDoc.Save(ms InputXMLFile)
End Using
End Using
End Using
Finally
Thanks,
Jim
I am trying to import data in a .csv file - the data contains English
pound signs (£). When importing data via filestreams etc I use the
"Default" code page - which is 1252 (ISO 8859-1). However I can see no
way to make the import of my csv file aware of this in the following
scenario, and the imported data contains character strings instead of
pound signs.
Can anyone help?
sPath = finputFile.Dire ctoryName
ExcelConnection = New
OleDb.OleDbConn ection("Provide r=Microsoft.Jet .OLEDB.4.0;Data Source= "
+ sPath + ";Extended Properties='tex t;HDR=Yes;FMT=D elimited;IMEX=1 ;'")
Try
Using ExcelCommand As New OleDb.OleDbComm and("SELECT *
FROM " + finputFile.Name , ExcelConnection )
Using ExcelAdapter As New
OleDb.OleDbData Adapter((ExcelC ommand)
ExcelConnection .Open()
Using ExcelDataSet As New DataSet()
ExcelAdapter.Fi ll(ExcelDataSet , "Supplier")
'// Create the XML file
oXMLDoc = New XmlDocument
oXMLDoc.Preserv eWhitespace = True
oXMLDoc.LoadXml (ExcelDataSet.G etXml())
oXMLDoc.Save(ms InputXMLFile)
End Using
End Using
End Using
Finally
Thanks,
Jim
Comment