代码咋倒了。 Kill "C:\SQLTB.dat"
strSQL = "exec master..xp_cmdshell 'bcp YBage..tb_ic out C:\SQLTB.dat -S127.0.0.1 -Usa -Pby123456 -w'"
With Rs
.Close
.LockType = adLockPessimistic
.CursorLocation = adUseClient
.CursorType = adOpenKeyset
.Open strSQL
End With
strSQL = "exec master..xp_cmdshell 'bcp ICClient..tb_ic in C:\SQLTB.dat -S127.0.0.1 -Usa -Pby68533462 -w'"
With Rs
.Close
.LockType = adLockPessimistic
.CursorLocation = adUseClient
.CursorType = adOpenKeyset
.Open strSQL
End With
Rs.MoveLast
While IsNull(Rs(0)) Or Trim(Rs(0)) = ""
Rs.MovePrevious
Wend
If Left(Rs(0), 5) = "Error" Then
DownLoadData = False
MsgBox "数据下载出错!请联系系统管理员!", vbInformation, "提示"
Exit Function
End If
Kill "C:\SQLTB.dat"
strSQL = "exec master..xp_cmdshell 'bcp YBage..tb_ic out C:\SQLTB.dat -S127.0.0.1 -Usa -Pby123456 -w'"
With Rs
.Close
.LockType = adLockPessimistic
.CursorLocation = adUseClient
.CursorType = adOpenKeyset
.Open strSQL
End With
strSQL = "exec master..xp_cmdshell 'bcp ICClient..tb_ic in C:\SQLTB.dat -S127.0.0.1 -Usa -Pby68533462 -w'"
With Rs
.Close
.LockType = adLockPessimistic
.CursorLocation = adUseClient
.CursorType = adOpenKeyset
.Open strSQL
End With
Rs.MoveLast
While IsNull(Rs(0)) Or Trim(Rs(0)) = ""
Rs.MovePrevious
Wend
If Left(Rs(0), 5) = "Error" Then
DownLoadData = False
MsgBox "数据下载出错!请联系系统管理员!", vbInformation, "提示"
Exit Function
End If
Kill "C:\SQLTB.dat"
WITH (DATAFILETYPE = 'widechar')
OLE DB provider 'STREAM' reported an error. The provider did not give any information about the error.
The statement has been terminated.