Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ADODC to show Excel file in a Datagrid,error

Status
Not open for further replies.

wawanz

Programmer
Aug 29, 2002
62
ID
I use this code to populate a datagrid with an Excel worksheet:
'----
Adodc1.ConnectionString = "Driver={Microsoft Excel Driver(*.xls)};DBQ=" & cFileName & ";DriverID=790"
Adodc1.RecordSource = "[" & cSheet & "$]"
Adodc1.Refresh

Set DataGrid1.DataSource = Adodc1
'---

My problem is:
Some of the fields in the datagrid are empty(treated as NULL), when actually there is a value when I open the Excel file. I use this grid to write the Excel records into an SQL table. My client said these Excel files are generated from another software, and they used macros to work on these Excel files. BUT if I re-type the values in those cells, the datagrid works(doesn't show an empty field). I don't want to tell my client to re-type everything...so anyone know what's wrong? Help please
 
Have you got a conflict between the type of data you expect in tyhe datagrid cells? A blank could be a null or a zero length string or a blank space!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top