Exporting to Excel and Apostrophies

  • Thread starter Thread starter John
  • Start date Start date
J

John

Hi All,
I am using the following function to output data to an excel (.xls) file via
a dataset, listview, etc...

Dim m_sConn1 As String = ""
m_sConn1 = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=" & FileName$ & ";Extended Properties=""Excel
8.0;HDR=YES"""
Dim conn As New OleDbConnection

I am INSERTing the data into the file.
All works wonderfully; but every cell has an Apostrophe in the beginning of
the cells value. I understand that this is representing a TEXT data type;
but it messes things up when trying to sort by dates or numbers.

Does anyone have any idea as to the resolution for this?

Thanks,
John.
 
...
John:

Are you using a Strongly Typed Dataset? If not, are you specifying the
column data types in your untyped dataset?

Is the OP even a dataset?! I understood he was excuting INERT INTO
statements against the Jet Provider.

Jamie.

--
 
The Source of the Data being exported to the file is in a variety of
forms.

DataSet
ListView
DataGrid
Etc...

The point is, regardless, I create the column structure and then the
Insert Into statement for each row. Everything works great with the
exception of the apostrophy bing created in the begining of each cell of
the file.

The only way to remove this apostropy is via another procedure/program
that loops through and removes this special character(by excel
standards).



*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top