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
'----
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