|
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件 ★ 免费下载 ★ ★ 使用帮助★
access通过以下方式上传一个excel到access,然后在须要的excel表中在通过VBA查询返回相对应的行,现在问题是footer_html列显示长文本,上传后在查询返回的就是255个字符,其它长文本单元格正常。想知道这种情况的原因是什么,要怎么解决。上传的excel对应列也是文本列。表格太大就不上传了,有60多M。希望大家告诉我下思路。
以下是代码:
Public Sub updata()
Set dOpen = Application.FileDialog(1)
With dOpen
.Filters.Clear
.Filters.Add "excel文档", "*.xlsx"
.Show
End With
If dOpen.SelectedItems.Count > 0 Then
FileName = dOpen.SelectedItems(1)
DoCmd.TransferSpreadsheet acImport, , "Sheet1", FileName, True
Else
FileName = ""
End If
Set dOpen = Nothing
Dim record As DAO.Recordset
Set record = CurrentDb.OpenRecordset("select * From record")
record.AddNew
record![caozuo] = "Updata"
record![shuju] = "Auto"
record![data] = Now()
record![file] = FileName
record.Update
record.Close
Set record = Nothing
Dim Row As String
strSQL = "Select count(item_number) AS hang from Sheet1"
Set record = CurrentDb.OpenRecordset(strSQL)
record.MoveFirst
Row = record!hang
MsgBox ("以上传表,现有行数-" & Row)
Set record = Nothing
End Sub
|
|