W
wjp1226
Unregistered / Unconfirmed
GUEST, unregistred user!
var
FilePath,strToday:string;
ShExecInfo:SHELLEXECUTEINFO ;
begin
SHExecInfo.cbSize := sizeof(SHELLEXECUTEINFO);
SHExecInfo.fMask := SEE_MASK_NOCLOSEPROCESS;
SHExecInfo.Wnd := application.Handle;
SHExecInfo.lpVerb := nil;
SHExecInfo.lpFile := pchar('bcp');
SHExecInfo.lpParameters := pchar(strfile);
SHExecInfo.lpDirectory := nil;
SHExecInfo.nShow := SW_SHOW;
SHExecInfo.hInstApp := application.Handle;
ShellExecuteEx(@SHExecInfo);
WaitForSingleObject(SHExecInfo.hProcess, INFINITE);
closeHandle(SHExecInfo.hProcess);
end;
我用上面的方法通过SHELLEXECUTEINFO调用bcp把多个文件倒入数据库中,可是第一次调用这个函数运行正常,倒入第二个文件时就只探出一个黑色命令行窗口,没有什么反应,也不倒入数据,这是什么原因呢?
期盼这个大牛指教!
FilePath,strToday:string;
ShExecInfo:SHELLEXECUTEINFO ;
begin
SHExecInfo.cbSize := sizeof(SHELLEXECUTEINFO);
SHExecInfo.fMask := SEE_MASK_NOCLOSEPROCESS;
SHExecInfo.Wnd := application.Handle;
SHExecInfo.lpVerb := nil;
SHExecInfo.lpFile := pchar('bcp');
SHExecInfo.lpParameters := pchar(strfile);
SHExecInfo.lpDirectory := nil;
SHExecInfo.nShow := SW_SHOW;
SHExecInfo.hInstApp := application.Handle;
ShellExecuteEx(@SHExecInfo);
WaitForSingleObject(SHExecInfo.hProcess, INFINITE);
closeHandle(SHExecInfo.hProcess);
end;
我用上面的方法通过SHELLEXECUTEINFO调用bcp把多个文件倒入数据库中,可是第一次调用这个函数运行正常,倒入第二个文件时就只探出一个黑色命令行窗口,没有什么反应,也不倒入数据,这是什么原因呢?
期盼这个大牛指教!