View Single Post
  #1 (permalink)  
Old April 11th, 2006, 06:32 AM
pranjaldutta pranjaldutta is offline
Registered User
 
Join Date: Apr 2006
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Java solution Read Mixed data columns from excel.

Hi Experts,

I am facing a problem in reading mixed datatypes from Excel files.
If a Column Datatype is Varchar but it has number stored in it,it fails to read those numbers.
I tried for IMEX=1 in the Connection String but it is not workiing .Client should be unaware of any DSN name ,so I hv used dynamic DSN.Plz give the proper syntax for that.
My present connection String is ::
String fileName = "MyXLS";


conn = DriverManager.getConnection("jdbc:odbc:Driver={Mic rosoft Excel Driver (*.xls)};DBQ=E:\\Pranjal\\DMT\\SourceXLS\\Approved Version\\"+fileName+".xls;DriverID=22;Extended Properties=’Excel 8.0;HDR=YES;IMEX=1';READONLY=false","","");





Moreover, I m successfull in this by using the following query.But my requirement is get ting mixed data types only through connection String.
Using a Select query below solves my problem but I want the same output using "Connection String" only.


"SELECT * FROM [Excel 8.0;HDR=YES;IMEX=1;Database=E:\\Pranjal\\DMT\\Sour ceXLS\\ApprovedVersion\\MyXlS.xls].[Issue 10 Schedule$];";


Thanks in Advance

Pranjal


Regards
Pranjal Dutta
Reply With Quote