7,785
社区成员




Option Explicit
Dim strfFleName
Dim sj() As String
Private Sub cmdOpen_Click() '确定文本文件的总行数
Dim sj() As String
Dim strS As String
Dim L As Integer
CommonDialog1.ShowOpen
strfFleName = CommonDialog1.FileName
Open strfFleName For Input As #1
Do While Not EOF(1)
Line Input #1, strS
ReDim Preserve sj(L)
sj(L) = strS
Debug.Print sj(L)
'以下写分割行数据并写入数据库语句
L = L + 1
Loop
Close #1
Text1 = UBound(sj)
End Sub