Reading excel sheet into a recordset

Reply

Join Date: Oct 2007
Posts: 10
Reputation: Pareshja is an unknown quantity at this point 
Solved Threads: 0
Pareshja Pareshja is offline Offline
Newbie Poster

Reading excel sheet into a recordset

 
0
  #1
Nov 8th, 2007
Hi Guys,

I need some help. My application reads an excel file and dumps it into a recordset. The problem is that if a coloumn in excel has numbers and text in it only the numbers are dumped into the recordset and not the text values. The text values are just blank


Set rsCat = New ADODB.Recordset
Set conn = New ADODB.Connection

sqlCatExcel = "select * from [All $]"
rsCat.CursorLocation = adUseClient

rsCat.Open sqlCatExcel, "DRIVER=Microsoft Excel Driver (*.xls);Extended Properties=excel 8.0;" & "DBQ=" & filename

Set DataGrid1.DataSource = rsCat


Please help
Reply With Quote Quick reply to this message  
Join Date: Dec 2006
Posts: 645
Reputation: binoj_daniel is an unknown quantity at this point 
Solved Threads: 17
binoj_daniel's Avatar
binoj_daniel binoj_daniel is offline Offline
DaniWeb Expert

Re: Reading excel sheet into a recordset

 
0
  #2
Nov 8th, 2007
Please check the column format of that excel file. Set it to text.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:




Views: 3303 | Replies: 1
Thread Tools Search this Thread



Tag cloud for Visual Basic 4 / 5 / 6
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2010 DaniWeb® LLC