"Invalid external statement arguments" Error

jha.bineet

New Member
Hi,

Can anyone help me resolve this error (Basic Error: 38 - "Invalid external statement arguments"). I have checked for the column mismatch, sequencing of columns and everything what I could have done.:confused::confused::confused:
Please reply.
 

Peter Headland

New Member
There are almost 100 possible reasons for this error. Please tell us the full error message (which should include a file and line number).

Have you overridden any methods?

What does the debugger show you when the error occurs?

What version of Actuate are you using?
 

jha.bineet

New Member
Thanks Peter for your response.

This error I solved myself. I was missing something in the Fetch () method.

Thanks again.
 

tanaspy

New Member
Please help...

I'm actually having the same problem... and it's pointing to

Basic Error: 38 Module: C:\Program Files\Actuate7\ErdPro\afc\db.bas Line: 524 Invalid external statement arguments.

The error occurs at:
db_cursor.BindColumn(1, "SqlQuerySource1::DataRow4", "tot_labcost")

Function GetPMCount(loc as String) As Integer
' Insert your code here
dim conn as AcDBConnection
set conn = GetDBConnection()
dim db_stmt as AcDBStatement
dim db_cursor as AcDBCursor
dim numpm as integer
numpm=0
dim db_row as DataRow4
set db_row = new DataRow4()

dim mysql as String

mysql = "select count(*) as ct from pm where pm.orgid='" & mroOrg & "' and pm.siteid='" & mroSite & "'"
mysql = mysql & " and pm.frequency>0 and pm.nextdate>='" & startDate & "'"
mysql = mysql & " and pm.nextdate<='" & endDate & "'"
mysql = mysql & " and pm.location in (select location from v_location_hierarchy where charindex('" & loc & ";', loc_ancestors)>0)"
set db_stmt = conn.Prepare(mysql)
if (db_stmt is nothing) then
ShowFactoryStatus("DB Connection Error 1: at connection")
exit function
end if
ShowFactoryStatus(mysql)

set db_cursor = db_stmt.AllocateCursor()
if (db_cursor is nothing) then
ShowFactoryStatus("DB Connection Error 2: at cursor")
exit function
else
if not (db_cursor.OpenCursor()) then
conn.RaiseError()
set db_cursor = nothing
exit function
else
db_cursor.BindColumn(1, "SqlQuerySource1::DataRow4", "tot_labcost")
db_cursor.Fetch(db_row)
numpm = db_row.GetValue("tot_labcost")
end if
end if
' clear all resources
set db_cursor = nothing
set db_stmt = nothing
set db_row = nothing
set conn = nothing

' return number of pm count
GetPMCount = numpm
End Function
 
Top