Forum Discussion

joffre's avatar
joffre
Regular Contributor
14 years ago

Wait for a command to continue executing

Hi all.



I need to make the code below, wait until the "EXIT " is informed to move to the next line of code.

I am using "Call Delay" but it isn't resolving, since not all commands invoked take the same amount.



Call TestedApps.cmd.Run(1, True) 'open the Command Prompt

Call Aliases.cmd.wndConsoleWindowClass.Keys(ComandoCriarTabela&"2.Nucleo\SQLServer\1.sql[Enter]Exit[Enter]")

Call Delay(5000)



Here are the variable declaration for your knowledge:

ComandoCriarTabela = "sqlcmd -S " &Servidor& " -d " &Database& " -U " &Usuario& " -P " &Senha& " -i " &Caminho&""

Servidor = "srv-tsbd\sql2k"

Database = "TS_F_SQL2K_20112"

Usuario = "homol"

Senha = "tssql2k"

Caminho = "D:\Scripts\Scripts_Criacao_Banco\"



It is working fine. The command is correct. I just need a solution for my problem. How to make my code wait until EXIT is informed?



Hope someone can help me.



Thanks.

36 Replies