Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Back to Sorting recordset w/ recordset Problem

Status
Not open for further replies.

ironyx

Technical User
Joined
Nov 13, 2001
Messages
134
Location
US
I am getting an error when I try to use a recordset to sort another. ADODB 800a0bcd

Which says, I don't have a current record. I see that I have records displaying in both recordsets that I set up when I run a test.

I have rsPersonnel which uses 2 tables, primary ID is PersID, it also queries for DocID.
I have rsPersonnelDoc which has multiple tables. I use var1 with a WHERE tblDoc.DocID in (var1) and a run time value of (rsPersonnel.Fields.Item("DocID").Value)

Now, I think it is my logic (I don't have any) rather than a missing record. Could someone take a look at this and let me know what ya think? I really appreciate any help...
Thanks!
:( Sad Va...
 
my first is to make sure that rsPersonnel is opened before rsPersonnelDoc.

other than that post some of the code to see if we can spot a syntax error The secret of life is honesty and fair dealing. If you can fake that, you've got it made.
Groucho Marx (1895-1977)
 
<%@LANGUAGE=&quot;JAVASCRIPT&quot;%>
<!--#include file=&quot;Connections/JSIPS.asp&quot; -->
<%var rsPersonnel = Server.CreateObject(&quot;ADODB.Recordset&quot;);
rsPersonnel.ActiveConnection = MM_JSIPS_STRING;
rsPersonnel.Source = &quot;SELECT * FROM tblPers LEFT OUTER JOIN tblPersDoc ON tblPers.PersID = tblPersDoc.PersID&quot;;
rsPersonnel.CursorType = 0;
rsPersonnel.CursorLocation = 2;
rsPersonnel.LockType = 3;
rsPersonnel.Open();
var rsPersonnel_numRows = 0;
%>
<%
var rsPersonnelDoc__var1 = &quot;18&quot;;
if(String(rsPersonnel(&quot;DocID&quot;)) != &quot;undefined&quot;) {
rsPersonnelDoc__var1 = String(rsPersonnel(&quot;DocID&quot;));
}
%>
<%
var rsPersonnelDoc = Server.CreateObject(&quot;ADODB.Recordset&quot;);
rsPersonnelDoc.ActiveConnection = MM_JSIPS_STRING;
rsPersonnelDoc.Source = &quot;SELECT tblDoc.DocID, tblDoc.DocName, tblDoc.Description, tblDoc.DocType, tblLoc.Loc_Code FROM tblLoc RIGHT JOIN (tblDoc LEFT JOIN tblDocLoc ON tblDoc.DocID = tblDocLoc.DocID) ON tblLoc.LocationID = tblDocLoc.LocID WHERE tblDoc.DocID = &quot;+ rsPersonnelDoc__var1.replace(/'/g, &quot;''&quot;) + &quot;&quot;;
rsPersonnelDoc.CursorType = 0;
rsPersonnelDoc.CursorLocation = 2;
rsPersonnelDoc.LockType = 3;
rsPersonnelDoc.Open();
var rsPersonnelDoc_numRows = 0;
%>
<%
var Repeat1__numRows = 10;
var Repeat1__index = 0;
rsPersonnel_numRows += Repeat1__numRows;
%>
<%
var Repeat2__numRows = 10;
var Repeat2__index = 0;
rsPersonnelDoc_numRows += Repeat2__numRows;
%>

It is starting to look all the same to me from staring so long. I appreciate any time taken to help!!!

tables are
tblLoc tblDocLoc tblDoc tblPersDoc tblPers
LocID LocID DocID PersID PersID
PersID DocID

I listed the main Field names with them. I think part of it is my SQL statement, I don't know databases that well, I am a web developer for the most part. So there could be some big part I am missing in that. If there are any more questions, (besides what the heck are you doing) let me know! Thanks :)
Virginia
 
I have 3 tables that have personnel info and then locations associated with them.
The tables are:
tblPers- containing all the personal information, with the Prim Key being PersID
tblPersLoc- with PersID and LocID (along with a couple of other fields)
tblLoc with LocID and all the location info

Now, I have to set up a page that has the Personal info in one section, then displays the remaining info in another section (or at least looks like that). I was hoping first to try and use a recordset to filter another, then was thinking I could pass a variable to another page. Now I have no idea. If someone could give me an idea of what to do, it would help unmuddle my brain. I have been messing with this so long, I don't even know where I started and why that didn't work.

I am using an Access Database and ASP/Javascript. PLEASE HELP ME :(
thanks!
Virginia
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top