检索从 MS SQL 到 QTP 的错误消息

Retrieve error message from MS SQL to QTP

我必须使用存储过程将文件加载到 MS SQL:

exec [database].[dbo].[tablename]  @FullFilePath = 'fullpathtofile'

文件很大,加载可能需要几分钟到 40 分钟。 UFT returns 'timeout' 错误在 20-30 秒内。 需要帮助使 UFT 等待文件加载。修复了wait()没有意义,因为我不知道具体需要多长时间。

For each objError in dbConnectionChargebacks.Errors 给我消息(例如 50000 作为加载错误或 3105 作为成功加载的文件 ID)。但它仅在 <20 秒内加载文件时有效。对于大文件,我不知道如何等待)

同意@Dave。将您的程序存储在批处理文件中并使用 Wscript 对象,您可以执行该文件

Set Wsc = CreateObject("Wscript.Shell")
intReturn = Wsc.Run("cmd /c " & PathofbatchFile, 1 True) 'true will wait until batch file returns completion code

0 是 return 成功代码。