473,322 Members | 1,188 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

Why does this function error?

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


Nov 18 '05 #1
1 996
Figured it out..."Zone" is a reserved word in OleDb for Access.
"J. Clay" <no********************@jimclay.com> wrote in message
news:Ob**************@TK2MSFTNGP11.phx.gbl...
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

Nov 18 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: lawrence | last post by:
Suppose I create dynamic web pages with 3 functions (which call other functions to make everything happen, but these 3 you might think of as being the top layer): registerSessions();...
8
by: Jaime Rios | last post by:
Hi, I created a COM AddIn for Word that performs the functions that it needs to, but I needed to add the ability for the toolbar created by the COM AddIn to remember it's last position and...
4
by: ezra epstein | last post by:
Aother head banger for me. Below is a complete example of the code Using Postgres 7.4, the function "test" gets this: psql:temp3.sql:10: ERROR: syntax error at or near "%" at character 135...
15
by: Greenhorn | last post by:
Hi, when a function doesn't specify a return type ,value what value is returned. In the below programme, the function sample()is returning the value passed to 'k'. sample(int); main() { int...
5
by: Dmitriy Lapshin [C# / .NET MVP] | last post by:
Hi all, I think the VB .NET compiler should at least issue a warning when a function does not return value. C# and C++ compilers treat this situation as an error and I believe this is the right...
2
by: Johann Robette | last post by:
Hi, I'm trying to call the array_to_string function like this : SELECT array_to_string(array, '~^~') --> it comes directly from the doc. I get this error msg : ERROR: parser: parse error at...
8
by: mastermagrath | last post by:
Hi, I'm about half way through Bruce Eckels thinking in C++ Vol 1. He gives a very short example of how compiler function name decoration helps remove subtle bugs by type-safe linkage. However,...
6
by: Bint | last post by:
I'm getting this returned from a PHP script. What does this mean? <b>Parse error</b>: syntax error, unexpected ')', expecting T_PAAMAYIM_NEKUDOTAYIM in <b>/ho Thanks B
2
ADezii
by: ADezii | last post by:
Many times when writing VBA code, we find the need to work with Files in one form or another. Whatever the process may be, we need to be sure that a File is present in a specified location. One...
0
by: remya1000 | last post by:
i'm using VB.Net 2005 application program. i'm trying to convert VB6 code to VB.Net 2005. QSockB is DLL file. this is the code i used for VB6. This is code i'm using to create socket, when...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.