Register forum user name Search FAQ

Gammon Forum

Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the password reset link.

Due to spam on this forum, all posts now need moderator approval.

 Entire forum ➜ Programming ➜ General ➜ Over flow Error

Over flow Error

It is now over 60 days since the last post. This thread is closed.     Refresh page


Posted by Sivap   (2 posts)  Bio
Date Tue 06 Jun 2006 03:17 PM (UTC)
Message
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
Top

Posted by Nick Gammon   Australia  (23,166 posts)  Bio   Forum Administrator
Date Reply #1 on Tue 06 Jun 2006 09:33 PM (UTC)
Message
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?

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


9,427 views.

It is now over 60 days since the last post. This thread is closed.     Refresh page

Go to topic:           Search the forum


[Go to top] top

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.