Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > Get Bad Data from a Recordset Call

Thread Tools

Get Bad Data from a Recordset Call

Posts: n/a
Here's the code:
accessID = request("accessID")

strSQL = "SELECT * From PendingAccRequests Where AccessID = "&accessID

'Create the Recordset object and run SQL statement
Set accRS = Server.CreateObject ("ADODB.Recordset")
accRS.Open strSQL, objConn

If request("confirm") = "yes" then
strSQL = "Select * From AccessMaster Where RequestID = "&accessID
'Create the Recordset object and run SQL statement
Set masterRS = Server.CreateObject ("ADODB.Recordset")
masterRS.CursorLocation = adUseClient
masterRS.Open strSQL, objConn,, adLockOptimistic

masterRS("PropownID") = accRS("Bld_Owner_ID")
masterRS("FileName") = accRS("PROPOWN_Name")
masterRS("Multiagreement") = False
masterRS("OpenDate") = Date()
masterRS("requestID") = accessID

strSQL = "Select * From Access Where MasterID =
'Create the Recordset object and run SQL statement
Set newRS = Server.CreateObject ("ADODB.Recordset")
newRS.CursorLocation = adUseClient
newRS.Open strSQL, objConn,, adLockOptimistic

newRS("Prop_Owner_ID") = accRS("Bld_Owner_ID")
newRS("Acct_Mgr") = accRS("Assigned")
newRS("Status") = "OPEN"
newRS("Source_Date") = accRS("AccessDate")
If Not IsNull(accRS("ProjID")) then
newRS("Source_Info") = "SALES REQUEST"
newRS("Source_Info") = "CONSTRUCTION"
End If
newRS("File_Received") = Date()
newRS("MasterID") = masterRS("MasterID")

If Not IsNull(accRS("ProjID")) then

strSQL = "Insert Into AccessBldg (AccessID, BidID) "&_
"Select "&newRS("AccessID")&", BID_ID from ConstructionBldg Where
ProjectID = "&accRS("ProjID"))

strSQL = "Update Building Set Bld_Access_ID =
"&masterRS("MasterID")&" Where Bld_Address_ID in "&_
"(Select Bid_ID From ConstructionBldg Where ProjectID =
"&accRS("ProjID")) &")"
strSQL = "Select * From AccessBldg Where AccessID =
'Create the Recordset object and run SQL statement
Set accBldRS = Server.CreateObject ("ADODB.Recordset")
accBldRS.CursorLocation = adUseClient
accBldRS.Open strSQL, objConn,, adLockOptimistic

accBldRS("AccessID") = accIDRS("AccessID")
accBldRS("BidID") = accRS("BidID")
accBldRS("suite") = accRS("Suite")

strSQL = "Select * From Building Where Bld_Address_ID =
'Create the Recordset object and run SQL statement
Set bldRS = Server.CreateObject ("ADODB.Recordset")
bldRS.CursorLocation = adUseClient
bldRS.Open strSQL, objConn,, adLockOptimistic
bldRS("Bld_Access_ID") = masterRS("MasterID")
End If
strSQL = "Update AccessRequest Set Completed = 1 Where AccessID =

Response.Redirect("handler.asp?id="&newRS("AccessI D") )

End If

Now you'll notice I'm updating and pulling from multiple recordsets.
Here's the problem.
PendingAccRequests is a View, and when I run the SQL query (Where
AccessID = "&accessID), I get good data.
So I plug it into accRS.
Now in that row there is a column called projID... it has the number
477 in it.
But Anytime I try and call that field (accRS("ProjID")) I get nothing.
It Will Not return my 477. This is the problem

Just FYI.
When I call newRS("AccessID") which is the ident key of the record I'm
adding, I also get nothing.
When I call accRS("Assigned") which is filled with the number 47, I
get nothing.
When I call masterRS("MasterID") which is another ident field of a
recordset I'm adding. I get the wrong number. I do not know where the
number is coming from.

Can anyone tell me what could be wrong???

Reply With Quote

Thread Tools

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

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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Bad media, bad files or bad Nero? John Computer Information 23 01-08-2008 09:17 PM
ActiveX apologetic Larry Seltzer... "Sun paid for malicious ActiveX code, and Firefox is bad, bad bad baad. please use ActiveX, it's secure and nice!" (ok, the last part is irony on my part) Java 0 04-16-2005 10:05 PM
24 Season 3 Bad Bad Bad (Spoiler) DVD Video 12 02-23-2005 03:28 AM
24 Season 3 Bad Bad Bad (Spoiler) DVD Video 0 02-19-2005 01:10 AM
RecordSet.Move or RecordSet.AbsolutePosition?? Hung Huynh ASP General 8 09-24-2003 11:07 AM