I've got a type mismatch error that's driving me nutty. Variable blnNoData
has the initial value False. If a recordset comes back empty (both .EOF and
..BOF are true) then blnNoData is set to True. I then have an if statement to
determine what to write to the screen depending on blnNoData. As long as the
if statement is true (doesn't have to go to the else clause), the code runs
fine. Otherwise, a type mismatch error is returned. In other words, if the
recordset is empty and I test "If blnNoData", then it's fine, but if the
recordset is not empty, the type mismatch error happens. If the recordset is
not empty and I test "If not blnNoData", then it's fine, but if the
recordset is empty the type mismatch error happens.
Code below:
dim sqlEMI, aryEMI, blnNoData
blnNoData = False
sqlEMI = "select emiNumber, emiTitle, savingsElectricity,
costSavingsElectricity, savingsDemand, costSavingsDemand, " &_
"nonEnergySavings, rebateorGrantAmount, netCostSavings, annualCostSavings,
simplePayback, recommended " & _
"from bem_trelDescriptionToEMI de " & _
"inner join bem_tblEMI e on de.emiid = e.emiid " &_
"inner join bem_tlkEMICodes ec on e.emitypeid =
ec.emitypeid " &_
"inner join bem_tlkBuildingSystem bs on bs.systemid =
de.systemid " &_
"where de.teaid = " & session("intTeaID")
getConn()
getRS(sqlEMI)
if adoRS.EOF and adoRS.BOF then
blnNoData = True
else
aryEMI = adoRS.GetRows
end if
closeRS()
closeConn()
'################################################# ######
'TABLE HEADER
'################################################# ######
response.write "<div class='smalllandscapereport'><div class=header><p>List
of EMI Savings & Cost</p></div>" & vbcrlf
'response.end
if blnNoData then
response.write "<p>Unable to retrieve EMI information. This may be
because you haven't entered any information for this form yet. Please review
form input and try again.</p>"
else
'....(display recordset results)
end if 1 2458
What line does the type mismatch occur.
Jeff
"LJgrnl" <LJ****@discussions.microsoft.com> wrote in message
news:B7**********************************@microsof t.com... I've got a type mismatch error that's driving me nutty. Variable
blnNoData has the initial value False. If a recordset comes back empty (both .EOF
and .BOF are true) then blnNoData is set to True. I then have an if statement
to determine what to write to the screen depending on blnNoData. As long as
the if statement is true (doesn't have to go to the else clause), the code
runs fine. Otherwise, a type mismatch error is returned. In other words, if
the recordset is empty and I test "If blnNoData", then it's fine, but if the recordset is not empty, the type mismatch error happens. If the recordset
is not empty and I test "If not blnNoData", then it's fine, but if the recordset is empty the type mismatch error happens.
Code below:
dim sqlEMI, aryEMI, blnNoData blnNoData = False
sqlEMI = "select emiNumber, emiTitle, savingsElectricity, costSavingsElectricity, savingsDemand, costSavingsDemand, " &_ "nonEnergySavings, rebateorGrantAmount, netCostSavings, annualCostSavings, simplePayback, recommended " & _ "from bem_trelDescriptionToEMI de " & _ "inner join bem_tblEMI e on de.emiid = e.emiid " &_ "inner join bem_tlkEMICodes ec on e.emitypeid = ec.emitypeid " &_ "inner join bem_tlkBuildingSystem bs on bs.systemid = de.systemid " &_ "where de.teaid = " & session("intTeaID")
getConn() getRS(sqlEMI) if adoRS.EOF and adoRS.BOF then blnNoData = True else aryEMI = adoRS.GetRows end if closeRS() closeConn()
'################################################# ###### 'TABLE HEADER '################################################# ###### response.write "<div class='smalllandscapereport'><div
class=header><p>List of EMI Savings & Cost</p></div>" & vbcrlf 'response.end if blnNoData then response.write "<p>Unable to retrieve EMI information. This may be because you haven't entered any information for this form yet. Please
review form input and try again.</p>" else '....(display recordset results) end if This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Arun Wadhawan |
last post by:
Hello
MY SQL Server is causing me this problem :
Microsoft VBScript runtime error '800a000d'
Type mismatch: 'ident'
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
I am getting from...
|
by: Mark |
last post by:
Hi - I tried this in VS.Net, and also in the Web Matrix code below: -
but I am getting a type mismatch error.
The sql statement runs perfectly from within the Access Query Designer.
Can anyone...
|
by: middletree |
last post by:
I've been messing with this for hours, and have been to various sites,
including Aaron's site, and am truly stumped.
The short version: in SQL Server, the 4 fields in question are datetime. I...
|
by: Mike |
last post by:
I am getting a type mismatch error when I do a bulk insert.
---Begin Error Msg---
Server: Msg 4864, Level 16, State 1, Line 1
Bulk insert data conversion error (type mismatch) for row 1, column...
|
by: Lee Chapman |
last post by:
Hi,
I have a problem where my ASP.NET application occasionally generates a
MissingFieldException exception. This unexpectedly happened on my development
box, and so I was able to extract some...
|
by: Brett |
last post by:
I have a form that calls a method within a DLL. By clicking a button on the
form, the DLL is instantiated and the SaveOutlookMessage() method invoked.
The DLL code copies messages from Outlook to...
|
by: Howard Kaikow |
last post by:
I'm doing a VB 6 project in which I am trying to protect against type
mismatch errors.
Is the process any different in VB .NET?
Here's what I'm doing in VB 6.
I have an ActiveX DLL.
The...
|
by: Brano |
last post by:
Hi all,
I have a asp.net website that has been live for about 2 weeks now and
there were no problems with it. I have got a new server that is Win
2003 IIS 6.0
I have moved my application onto...
|
by: lawrence k |
last post by:
I've got an intermittent bug that is very hard to trace. On my site, if
I log into a new account and try to upload some images, something goes
wrong the first time. Everything works fine after the...
|
by: DolphinDB |
last post by:
Tired of spending countless mintues downsampling your data? Look no further!
In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
|
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...
|
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...
|
by: Vimpel783 |
last post by:
Hello!
Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
|
by: jfyes |
last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
|
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)...
|
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...
|
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
|
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...
| |