luchifer,
Cita:
Tomado de la Ayuda en Delphi 7 (Win32 Developer's References):
The WinExec function runs the specified application.
This function is provided for compatibility with earlier versions of Windows. For Win32-based applications, use the CreateProcess function.
|
Preguntas:
1- ¿Si ejecutas el comando bcp "select * from bd_cona..cta where asoc in (select cod from bd_cona..ltablas where tab='+car+'ASO'+car+' and tiene='+car+'1'+car+')" queryout Bcta.txt -c -T directamente en la consola de Windows 7 funciona?
2- ¿Por que cmd /k y no cmd /c?, con /c ejecuta el comando y termina la instancia de consola, con /k la instancia se mantiene abierta.
3- ¿Es bd_cona..cta or bd_cona.cta?
Prueba cambiar WinExec por ShellExecute:
Código Delphi
[-]
ShellExecute(0, nil, 'cmd.exe', '/C bcp "select * from bd_cona..cta where asoc in (select cod from bd_cona..ltablas where tab='+car+'ASO'+car+' and tiene='+
car+'1'+car+')" queryout Bcta.txt -c -T', nil, SW_HIDE);
Esa es la idea general, tienes que probarla.
Espero sea útil
Nelson.