Guys, I have a script that uploads data from excel into oracle this is working perfectly.
What I would like to happen is a message box to pop up confirming that the records have been successfully inserted into the table.
I believe I have a solution to that but don't know how to get the value returned to me as a message box on successful. Of course if it isn't successful the message box should state that.
the section that shows "countSQL" is the sql that I want to run to validate if the records have been entered for that day.
Public Sub Insert_Oracle()
Dim cn As ADODB.Connection
Dim baseSQL, exSQL As String
Dim countSQL, exSQL1 As String
Dim source As String
Dim user As String
Dim password As String
Dim row, i As Long
source = Login.TextBox1.Value
user = Login.TextBox2.Value
password = Login.TextBox3.Value
Set cn = New ADODB.Connection
cn.Open "Provider=OraOLEDB.Oracle; Data Source=" & source & "; User Id=" & user & "; Password=" & password & ""
baseSQL = "INSERT INTO IFSAPP.INTERFACE_PLANNING_TAB (OBJECT_ID, WO_NO, SITE, CRAFT, CRAFT_RATE, QTY_HOURS, AMOUNT, DAY, OBJID) " & _
"VALUES ( $col1, $col2, '$col3', '$col4', $col5, $col6, $col7, to_date('$col8','dd/mm/yyyy'), SYSDATE) "
countSQL = "select count(*) as count from ifsapp.interface_planning_tab where trunc(objid) = trunc(sysdate)"
row = 2
Do While Cells(row, 1) <> ""
exSQL = baseSQL
For i = 1 To 9
exSQL = Replace(exSQL, "$col" & i, Cells(row, i))
row = row + 1
If cn.Errors.Count = 0 Then