I am writing a procedure that takes a file and imports it into a table. It is a simple file that was exported using bcp, and I'm trying to use a bcp call through ShellExecute to import the file back in. The problem I'm running into is that I make the call, the command prompt flashes (showing text that I can't read because it flashes too fast), then no data is imported. I have run the script manually, and it inserts fine, but my call from my program is not working. Any thoughts?
Here's my code:
strCommand := db.dbo.table in "file name" -S server\instance,port -U username -P password -N
ShellExecute(Application.Handle, 'open', pchar('bcp.exe'), pchar(strCommand), nil, SW_SHOWNORMAL);