Why does this function error?

J

J. Clay

I have this following function in a module in a dll that I am using for my
aspx site. I get the following error:
"IErrorInfo.GetDescription failed with E=FAIL(0x80004005)"

If I remove the OleDb Calls and just return one of the parameters it works.
But for some reason, this OleDb Call is causing all sorts of havoc. It
looks exactly the same as others I am using, unless I am missing something
VERY obvious.

If anyone has any suggestions I would be extremely gratefull.

TIA -- J. Clay

**********Code Follows**************

Function CalcUPS( intWeight AS Integer, strZip As String ) AS Decimal
Dim con As OleDbConnection
Dim str as String
Dim cmd As OleDbCommand
Dim strZone As String
Dim decRate As Decimal

' Prepare for db connection
con = New OleDbConnection( mstrConSys )
con.Open()

str = "SELECT Zone FROM UPSZone WHERE ZIP = '838'"
cmd = New OleDbCommand( str, con )
strZone = cmd.ExecuteScalar()
cmd = Nothing

Return strZone
'Code removed that is currently commented out

End Function
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top