COMException was unhandled?

NLRabit

New member
Joined
Jul 24, 2009
Messages
1
Programming Experience
1-3
Hey All - I am "very" new to VB, and am trying to learn it as quickly as possible, however I have hit a wall. When i try to run the small program i created it throws up this error "COMException was unhandled", and points it to this piece of code: Return m_oConnection.Execute(template) Im not really sure what to do. Any help would be great.

Here's the balance of the code:

'This function triggers a stored proc in the database which gets information from the database, using an optional EmpSysId.

Function getEmployeeInformation(Optional ByVal EmpSysId As String = "") As ADODB.Recordset

Dim template As String = "EXECUTE [uspEmployeeInformationGet] @EmpSysId = '{EmpSysId}'"

If EmpSysId = "" Then
template = Replace(template, " @EmpSysId = '{EmpSysId}'", "NULL")
Else
template = Replace(template, "{EmpSysId}", EmpSysId)
End If

Return m_oConnection.Execute(template)

End Function
 
Back
Top