VERSION 1.0 CLASS
BEGIN
  MultiUse = -1  'True
END
Attribute VB_Name = "c_DBMessage"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = False
'Generated by IDL2VB v120. Copyright (c) 1999 Martin.Both
'Source File Name: ../demos/db_query/database.idl
'Target File Name: c_DBMessage.cls

Option Explicit

'struct ::DB::Message
Const sTypeId As String = "IDL:DB/Message:1.0"

'Member
Public sqlcode As Long
Public sqlstate As String
Public sqlmessage As String

'Helper
Public Sub initByRead(ByVal oIn As cOrbStream)
    On Error GoTo ErrHandler
    sqlcode = oIn.readLong()
    sqlstate = oIn.readString(5)
    sqlmessage = oIn.readString(255)
    Exit Sub
ErrHandler:
    Call VBOrb.ErrReraise(Err, "Message.read")
End Sub

'Helper
Public Sub writeMe(ByVal oOut As cOrbStream)
    On Error GoTo ErrHandler
    Call oOut.writeLong(sqlcode)
    Call oOut.writeString(sqlstate)
    Call oOut.writeString(sqlmessage)
    Exit Sub
ErrHandler:
    Call VBOrb.ErrReraise(Err, "Message.write")
End Sub

'Helper
Public Sub initByAny(ByVal oAny As cOrbAny)
    On Error GoTo ErrHandler
    sqlcode = oAny.getLong()
    Call oAny.nextPos
    sqlstate = oAny.getString()
    Call oAny.nextPos
    sqlmessage = oAny.getString()
    Call oAny.nextPos
    Exit Sub
ErrHandler:
    Call VBOrb.ErrReraise(Err, "initByAny")
End Sub

'Helper
Public Sub insertIntoAny(ByVal oAny As cOrbAny)
    On Error GoTo ErrHandler
    Call oAny.insertLong(sqlcode)
    Call oAny.nextPos
    Call oAny.insertString(sqlstate)
    Call oAny.nextPos
    Call oAny.insertString(sqlmessage)
    Call oAny.nextPos
    Exit Sub
ErrHandler:
    Call VBOrb.ErrReraise(Err, "insertIntoAny")
End Sub
