datagrid导入Excel后其中一列显示不全
我的EXCEL表中有一“客户”列,内容为10056,10087,联通,移动,X3498,X7843.......但我导入datagrid后,这一列只显示10056,10087,其余的为空白,不显示。我把EXCEL中这一列的单元格格式改成“通用”或“文本”,情况如上。请问怎么回事?我导入EXCEL的语句是:
CDlg.DialogTitle = "打开 EXCEL 文件"
CDlg.Filter = "所有 EXCEL 文件|*.xls"
CDlg.ShowOpen
If CDlg.FileName = "" Then Exit Sub
Text1.Text = CDlg.FileName
If Conn.State = adStateOpen Then Conn.Close
Conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Persist Security Info=False;Data Source=" & CDlg.FileName & ";Extended Properties='Excel 8.0;HDR=Yes'" '连接EXCEL文件
sql = "select * from [sheet1$]" '打开EXCEL表
rs.CursorLocation = adUseClient
rs.Open sql, Conn, 3, 3
Label1.Caption = "共有记录: " & rs.RecordCount
Set DataGrid1.DataSource = rs