Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

update database from actuate

Status
Not open for further replies.

mprisco

Programmer
Sep 20, 2005
13
US
We are using actuate with maximo. I have code to update a field in the database and it works in ERD pro. When I publish the report the update no longer works. I've tried putting the code in various methods but it just doesn't seem to work from Maximo. Anyone have any ideas?

Thanks!
 
Try putting the code in the FinishReport event of the report (at the top-level).

We do things where we update or insert records into the database from Actuate reports.

I believe that the Actuate Encyclopaedia has had service pack 2 installed and so the code for updating the database had to be modified.

I have this code in the FinishReport Sub:
Sub FinishReport( )
Super::FinishReport( )

Dim position as integer
Dim stmt As AcDBStatement
Dim cursor As AcDBCursor
Dim newConnection As AcDBConnection
Dim strCommit as String
Dim strSQL As String
Dim aRow As AcDataRow
Dim msg as string
Dim nl as string

nl = chr$(10)

Set newConnection=New Connection
newConnection.connect

If (newConnection.IsOpen) Then
for position = lbound(arrayGeneric,1) to ubound(arrayGeneric,1)
strSQL = "UPDATE " & Schema & ".INVRESERVE"
strSQL = strSQL & " SET picklistno=" & glngPickListNo
strSQL = strSQL & ",picklistqty=" & arraygeneric(position,1)
strSQL = strSQL & " where rowid ='" & arraygeneric(position,0) & "'"

Set stmt = New AcDBStatement(newConnection)
stmt.prepare(strSQL)

If not stmt.execute() Then
newConnection.raiseError()
Set stmt = Nothing
exit sub
End If
Set stmt = Nothing
Next
strCommit = "COMMIT"
Set stmt = New AcDBStatement(newConnection)
stmt.prepare(strCommit)
If Not (stmt.execute()) Then
newConnection.raiseError()
End If
End if
End Sub

The array arrayGeneric is populated in the OnRow Sub of the frame where records are displayed:

Sub OnRow( row As AcDataRow )
ReDim Preserve arrayGeneric(i,1)
Super::OnRow( row )
arrayGeneric (i,0) = row.GetValue("strROWID")
arrayGeneric (i,1) = row.GetValue("INVRESERVE_COMMITTEDQTY")
i = i+1
End Sub

Hope this helps some.

Pete


 
Thanks for the response. I have our code in the finish event. It works in ERD Pro and from the management console. Doesn't work from Maximo!! I'll compare your code to mine, maybe I need to change something.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top