Function ProcessingString(strString As String)
'作用: 根据内容,写入临时表
'参数: strString 要写入表的内容.
Dim rst As Recordset, rstRecondCount As Long, strLong As Integer, PendingString As String, RemainingString As String, i As Byte, theEnd As Boolean
On Error Resume Next
Set rst = CurrentDb.OpenRecordset("tblContent", dbOpenDynaset)
rst.MoveLast
rstRecondCount = DCount("*", "tblContent") + 1
Dim j
'取出内字符
For j = 1 To Len(strString)
RemainingString = Mid(strString, j, 1)
If RemainingString <> Chr$(10) Then
strLong = strLong + LenB(StrConv(RemainingString & "", vbFromUnicode)) '统计字节数
PendingString = PendingString & RemainingString
End If
'写入表 满64字节或换行符
If strLong >= 64 Or RemainingString = Chr$(10) Then
strLong = 0
rst.AddNew
rst("ID") = rstRecondCount
rst("content") = PendingString
rst.Update
rstRecondCount = rstRecondCount + 1
PendingString = ""
End If
Next j
End Function
根据字节数判断是否换行