I feel you can best create a batch file to Invoke sql*loaderr and define all the parameters on the OS like the control file,data file and call this batch file from VB.I think you can call a file from VB
I have VB 5 professional, SP3 and personal Oracle 8.1.6. on my PC at home. I just started a new "Standard EXE" project in VB, added one button with the following code:
Private Sub Command1_Click()
Dim retval
retval = Shell("c:\oradb\bin\sqlldr.exe userid=user/pwd@mydb control=c:\temp\testdat.ctl bad=c:\temp\testdat.bad log=c:\temp\testdat.log")
End Sub
I then clicked the button and the rows were inserted as expected.
CONTROL FILE:
load data
infile "c:\temp\testdat.dat"
into table loadtest
fields terminated by ','
(a,
b)
DATA FILE:
"One","One"
"Two","Two"
What are you doing differently than this, and what exactly do you mean when you state:
"but both these formats do not work."
What doesn't work? What exactly happens? Do you see a momentary DOS window open? Does your log or bad file get populated?
Bookmarks