D
DFW_LZL
Unregistered / Unconfirmed
GUEST, unregistred user!
procedure TForm1.b1Click(Sender: TObject);
begin
WinExec(Pansichar('dbstop -c "uid=dba;pwd=lzl;eng=yss" -y'), SW_HIDE);
end;
procedure TForm1.b2Click(Sender: TObject);
begin
DATA1 := TADOConnection.Create(NIL);
data1.LoginPrompt := false;
data1.ConnectionString :='Provider=MSDASQL.1;Password=lzl;Persist Security Info=True;User ID=dba;Data Source=yss';
data1.Connected := true;
end;
procedure TForm1.b3Click(Sender: TObject);
begin
WinExec(Pansichar('dbstop -c "uid=dba;pwd=lzl;eng=yss" -y'), SW_HIDE);
DATA1 :=TADOConnection.Create(NIL);
data1.LoginPrompt := false;
data1.ConnectionString :='Provider=MSDASQL.1;Password=lzl;Persist Security Info=True;User ID=dba;Data Source=yss';
data1.Connected := true;
end;
先点击b1,再先点击b2,则代码执行能达到预期效果,但将b1 b2合并为b3后,点击b3,则inExec(Pansichar('dbstop -c "uid=dba;pwd=lzl;eng=yss" -y'), SW_HIDE)后的代码执行后,有时无反映.但我在WinExec(Pansichar('dbstop -c "uid=dba;pwd=lzl;eng=yss" -y'), SW_HIDE);后加一句MessageBox(0,'xxxxxx','提示',MB_OK+MB_ICONINFORMATION);则可以.
请问是何原因,如何解决?
begin
WinExec(Pansichar('dbstop -c "uid=dba;pwd=lzl;eng=yss" -y'), SW_HIDE);
end;
procedure TForm1.b2Click(Sender: TObject);
begin
DATA1 := TADOConnection.Create(NIL);
data1.LoginPrompt := false;
data1.ConnectionString :='Provider=MSDASQL.1;Password=lzl;Persist Security Info=True;User ID=dba;Data Source=yss';
data1.Connected := true;
end;
procedure TForm1.b3Click(Sender: TObject);
begin
WinExec(Pansichar('dbstop -c "uid=dba;pwd=lzl;eng=yss" -y'), SW_HIDE);
DATA1 :=TADOConnection.Create(NIL);
data1.LoginPrompt := false;
data1.ConnectionString :='Provider=MSDASQL.1;Password=lzl;Persist Security Info=True;User ID=dba;Data Source=yss';
data1.Connected := true;
end;
先点击b1,再先点击b2,则代码执行能达到预期效果,但将b1 b2合并为b3后,点击b3,则inExec(Pansichar('dbstop -c "uid=dba;pwd=lzl;eng=yss" -y'), SW_HIDE)后的代码执行后,有时无反映.但我在WinExec(Pansichar('dbstop -c "uid=dba;pwd=lzl;eng=yss" -y'), SW_HIDE);后加一句MessageBox(0,'xxxxxx','提示',MB_OK+MB_ICONINFORMATION);则可以.
请问是何原因,如何解决?