Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
Thread: error on display
06-08-2007, 03:11 PM #1
- Join Date
- Jan 2007
- Thanked 0 Times in 0 Posts
error on display
i just added the 2 following sql commands to my coding as i need to get some data from a different database.
but it keeps throwing this error when i try to display the data from this new command:
here's the code i've used to display it
if objrs6.eof or isNull(objrs6("DisMonth")) = true or objrs6("DisMonth") = "" then DisMonth = "0" else DisMonth = objrs6("DisMonth") end if
/Internal Programs/Discount/breakdown_view.asp, line 139
this line points to the sql command i named SnapshotDiscounts( ). It gets the discount value for the 1st 2 suppliers but when it tries to get it for the 3rd the error comes up.
i checked on the net and microsoft are saying it hapens when you point to a text or memo field in the table. but all my fields are set as numbers.
the supplier it points to, 'B83M', doesnt exist in the table so it should just skip that supplier and move onto the next one but isnt working for some reason.
sub GetSuppliers( ) SET objRs5 = SERVER.createObject( "ADODB.recordSet" ) dim mysql mysql = mysql + "" mysql = mysql + "SELECT Supplier, [net-turnover@"& myNewMonth &"] AS MonthTO " mysql = mysql + "FROM usalanalysis " mysql = mysql + "WHERE Customer = '"& objrs("Customer") &"' " mysql = mysql + "AND [year-number] = '" & myYear & "' " mysql = mysql + "ORDER BY Supplier" 'response.write(mysql) 'response.end objRs5.OPEN mysql,objConn,1,3 end sub sub SnapshotDiscounts( ) SET objRs6 = SERVER.createObject( "ADODB.recordSet" ) dim mysql mysql = mysql + "" mysql = mysql + "SELECT Supplier, [Sett@"& myNewMonth &"] AS DisMonth FROM Settlement_Out " mysql = mysql + "WHERE [Year-Number] = "& myYear &" " mysql = mysql + "AND Supplier = '"& objrs5("Supplier") &"' " mysql = mysql + "ORDER BY Supplier" response.write(mysql) 'response.end objRs6.OPEN mysql,objConn3,1,3 end sub
06-09-2007, 05:33 AM #2
- Join Date
- Jun 2002
- Thanked 236 Times in 233 Posts
Code:DisMonth = "0" if not objrs6.eof and not objrs6.bof then if not isNull(objrs6("DisMonth")) and objrs6("DisMonth") <> "" then DisMonth = objrs6("DisMonth") end if end if
Last edited by glenngv; 06-09-2007 at 05:50 AM.
Tower of Hanoi Android app (Ad-FREE!)
Tower of Hanoi Android app (FREE!)
Tower of Hanoi Leaderboard
Samegame Facebook App
Samegame Facebook App Leaderboard
vBulletin 5 Floating Bar extension
vBulletin 5 Slideshow extension
vBulletin 5 Quote Selected Text extension
vBulletin 5 Profile Preview Tooltip extension