Over flow Error

Posted by Sivap on Tue 06 Jun 2006 03:17 PM — 2 posts, 10,252 views.

#0
Hi,

I have a asp page when i am inserting record to three tables. I am using VB COM to insert/update records to the DB2 database.I am getting an overflow error in my com function.Please let me know whts wrong in this function

below is my COM function.

Public Function InsertNewBusEmpRole( _
ByVal EmproleID As Integer, _
ByVal EmpID As String, _
ByVal DivCD As String, _
ByVal RoleCD As String, _
ByVal GeoRGNCD As String, _
ByVal PLNGLAmt As Integer, _
ByVal TRNSTNPayMos As Integer, _
ByVal ExpDate As Date, _
ByVal UserID As String _
) As Integer

Dim StrSql As String
Dim strDBOwner As String
Dim inExpireDate As String
Dim RoleDate As Date

Dim oDataObject As EcolabData.ecoDataEngine
Set oDataObject = mobjContext.CreateInstance("EcolabData.ecoDataEngine")

strDBOwner = oDataObject.GetDBOwner(strAbstractName)
EmpID = oDataObject.ValidateSQLInput(EmpID, edStringInput, 8)
DivCD = oDataObject.ValidateSQLInput(DivCD, edStringInput, 3)

If ExpDate = "9999-12-31" Then
RoleDate = "9999-12-31"
Else
RoleDate = date()
End If

StrSql = "INSERT INTO " & strDBOwner & ".NEW_BUS_EMP_ROLE "
StrSql = StrSql & " (EMP_ROLE_ID, "
StrSql = StrSql & " EMP_ID, "
StrSql = StrSql & " DIV_CD, "
StrSql = StrSql & " ROLE_CD, "
StrSql = StrSql & " ROLE_STRT_DT, "
StrSql = StrSql & " ROLE_END_DT, "
StrSql = StrSql & " ROLE_STAT_CD, "
StrSql = StrSql & " TRNSTN_PAY_MOS, "
StrSql = StrSql & " TRNSTN_PAY_STRT_DT, "
StrSql = StrSql & " TRNSTN_PAY_END_DT, "
StrSql = StrSql & " SLS_GL_CHNG_IND, "
StrSql = StrSql & " GEO_RGN_CD, "
StrSql = StrSql & " PLN_GL_AMT, "
StrSql = StrSql & " CREATE_DATE, "
StrSql = StrSql & " CREATE_TIME, "
StrSql = StrSql & " MODIFY_DATE, "
StrSql = StrSql & " MODIFY_TIME, "
StrSql = StrSql & " CREATE_OPERATOR, "
StrSql = StrSql & " MODIFY_OPERATOR) "

StrSql = StrSql & "VALUES ("
StrSql = StrSql & EmproleID & ","
StrSql = StrSql & "'" & EmpID & "',"
StrSql = StrSql & "'" & DivCD & "',"
StrSql = StrSql & "'" & RoleCD & "',"
StrSql = StrSql & "'" & ExpDate & "',"
StrSql = StrSql & "'9999-12-31',"
StrSql = StrSql & "'A',"
StrSql = StrSql & TRNSTNPayMos & ","
StrSql = StrSql & "'" & RoleDate & "',"
StrSql = StrSql & "'9999-12-31',"
StrSql = StrSql & "'U',"
StrSql = StrSql & "'" & GeoRGNCD & "',"
StrSql = StrSql & PLNGLAmt & ","
StrSql = StrSql & "'" & Date & "',"
StrSql = StrSql & "'" & Now() & "',"
StrSql = StrSql & "'" & Date & "',"
StrSql = StrSql & "'" & Now() & "',"
StrSql = StrSql & "'" & UCase(UserID) & "',"
StrSql = StrSql & "'" & UCase(UserID) & "')"

Debug.Print StrSql

InsertNewBusEmpRole = oDataObject.ExecuteNonQuery(StrSql, strAbstractName, adCmdText)

Set oDataObject = Nothing

mobjContext.SetComplete

End Function


Help Would be really appreciated.

Thanks,
Siva
Australia Forum Administrator #1
This is not a MUSHclient bug report, so I have moved your post to Programming thread.

What is printed for StrSql? What line in your script does the overflow occur on? Can you point to it?