Welcome to the dBforums forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions, articles and access our other FREE features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload your own photos and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact support.

If you prefer not to see double-underlined words and corresponding ads, place your cursor
here for ContentLink opt out.

Go Back  dBforums > Data Access, Manipulation & Batch Languages > ASP > Strange behaviour of the recordset

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 04-10-03, 10:08
peter.sipka peter.sipka is offline
Registered User
 
Join Date: Apr 2003
Posts: 2
Strange behaviour of the recordset

Hi Guys,

I'm relatively new in the world of ASP, but that problem seems to be a bug.

I have a code to select records fom a database table. However if one of the fields contains a number whose last digit is a zero it generates an error. I attached the code and the table specification (an Oracle database).

So the only thing what I should change is the month value in the database from 10 to ex. 15

It's strange, isn't it...?

<%@ LANGUAGE=VBScript %>

<title>Prepaid hiváslista regisztrálás lekérdezés</title>
<HTML>
<BODY BGCOLOR=#EAEAEA>

<table border=0 cellspacing=0 cellpadding=0 WIDTH="100%">
<td>
<img width=225 src="./VBFlag25_P.jpg" >
</td>
<td>
<center><FONT SIZE=7><i>Prepaid híváslista regisztrálás</i></font></center>
</td>
</table>
<hr>
<br><br><br><br>

<CENTER><table border=1 cellspacing=0 cellpadding=0 WIDTH="60%">
<TR ALIGN=center><TD><B>Sorszám</B><TD><B>MSISDN</B><TD><B>Az igényelt híváslista éve</B><TD><B>Az igényelt híváslista hónapja<TD></B></TR>

<%
// -----------------------------------------------------
// The following code generates a database connection
// and collects the active records belonging to a
// prepaid subscriber.
// -----------------------------------------------------
Set OracleConn = Server.CreateObject("ADODB.Connection")
DSN="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
OracleConn.Open DSN
dtmVar = Now()
months = Array("Invalid","January","February","March","Apri l","May","June","July","August","September","Octob er","November","December")



'Instantiate a Recordset object.
Set rst2Requests = Server.CreateObject("ADODB.RecordSet")


'Open a recordset using the Open method
'and use the connection established by the Connection object.
strSQL = "SELECT MSISDN, PERIOD_YEAR, PERIOD_MONTH as MONTH from BSCCBS.Subscriber_invoice_request WHERE MSISDN="
strSQL = strSQL & Request.form("MSISDN")

Set rst2Requests = OracleConn.Execute(strSQL)

'rst2Requests.Open strSQL, OracleConn

'Cycle through record set and display the results
'and increment record position with MoveNext method.
Set objMSISDN = rst2Requests("MSISDN")
'Set objPERIOD_YEAR = rst2Requests("PERIOD_YEAR")
'Set objPERIOD_MONTH = rst2Requests("PERIOD_MONTH")
serialNumber = 0



Do Until (rst2Requests.EOF)
serialNumber = serialNumber + 1
Response.Write "<TR ALIGN=center>" & "<TD>" & serialNumber & "<TD>" & objMSISDN & "<TD>" & rst2Requests("PERIOD_YEAR") & "<TD>" & rst2Requests("MONTH").value & "</TR>"
rst2Requests.MoveNext
Loop

rst2Requests.Close
Set OracleConn = Nothing
%>






-------------------------------
CREATE TABLE SUBSCRIBER_INVOICE_REQUEST (
REQUEST_NUMBER NUMBER (10) DEFAULT 0 NOT NULL,
MSISDN VARCHAR2 (20) NOT NULL,
PERIOD_YEAR NUMBER (4) NOT NULL,
PERIOD_MONTH NUMBER (2) NOT NULL,
REGISTRATION_DATE DATE,
REGISTERED_BY VARCHAR2 (20),
LASER_FILE_FLAG VARCHAR2 (1) DEFAULT 'N' NOT NULL,
LASER_FILE_DATE DATE)
Reply With Quote
  #2 (permalink)  
Old 04-10-03, 10:14
peter.sipka peter.sipka is offline
Registered User
 
Join Date: Apr 2003
Posts: 2
Here is the error message:

Error Type:
Microsoft OLE DB Provider for ODBC Drivers (0x80040E21)
Multiple-step OLE DB operation generated errors. Check each OLE DB status value, if available. No work was done.
/process3.asp, line 59

the line #59 is :

Response.Write "<TR ALIGN=center>" & "<TD>" & serialNumber & "<TD>" & objMSISDN & "<TD>" & rst2Requests("PERIOD_YEAR") & "<TD>" & rst2Requests("MONTH").value & "</TR>"

The interesting is that after I change the PERIOD_MONTH value of the problematic record from 10 to ex. 15 everithing goes fine...

Any idea?

Thanx
Reply With Quote
  #3 (permalink)  
Old 04-11-03, 18:21
kiranmath kiranmath is offline
Registered User
 
Join Date: Feb 2003
Posts: 6
Re: Strange behaviour of the recordset

Check your Sql Statement.
It should be
WHERE MSISDN='" & Request.form("MSISDN") & "'"

Hope that helps
Kiran Math
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On