row = 2
Do
If excel_sheet.Cells(row, 1) = "" Then Exit Do
rs.AddNew
For col = 1 To n
If col > fldCount Then
Exit For
End If
If excel_sheet.Cells(row, col) = Null Then
Exit For
ElseIf excel_sheet.Cells(row, col) = "" Then
Exit For
End If
new_value = Strings.Trim(excel_sheet.Cells(row, col))
rs.Fields(col - 1).Value = new_value
Label3.Caption = "正在导入: " & new_value
Next col
' If row >= ProgressBar1.Max Then
' ProgressBar1.Max = row + 10
' End If
ProgressBar1.Value = row
row = row + 1
rs.Update
Loop
' ProgressBar1.Max = row
' ProgressBar1.Value = ProgressBar1.Max
Label3.Caption = "导入完成!"
excel_app.ActiveWorkbook.Close
excel_app.Quit
Set excel_sheet = Nothing
Set excel_app = Nothing
rs.Close
Set rs = Nothing
Screen.MousePointer = vbDefault
MsgBox "恭喜您,成功导入数据" & CStr(row - 2) & "行!"
ProgressBar1.Visible = False
Label3.Visible = False
Text1.Text = ""
Command1.Enabled = True
Command3.Enabled = True
End If