# Miscellaneous > Database Programming >  Drill Down

## Stuart Paice

i have created a drill down like the one on 
http://208.196.181.86/apps/mh-drill-down.asp
and with mine the second drill down does not load all the values if the previous load from the first drill down had fewer values. I think that the second window is holding a record count and that is why it only shows a few values. how can i get this to refresh so that all the values are loaded in the second window

my code looks like this

<%
Set MyDb = Server.CreateObject(&#34;ASP.db&#34 :Wink: 
Mydb.dbDBType=&#34;SQL&#34;

  MyDb.dbQuickProps = &#34;10271;W#;SR#;Grid;;;;SQL;100&#34;
  MyDb.dbNavigationItem=&#34;none&#34;
  MyDb.dbstatusbar=false
  MyDb.dbSQL=&#34;SELECT DISTINCT c# FROM sr#$&#34;
  MyDb.dbSelectBox=&#34;10,<B>Client Name</B>, Select Employee; #client#&#34;
  MyDb.dbColor = &#34;2&#34;
  MyDb.dbGridTableTag = &#34;Border=1&#34;
  MyDb.dbExportFlds=&#34;client&#34;

&#39;MyDb.dbReset(10272)

  MyDb.ASPdb
%>
</TD>

<TD valign=&#34;middle&#34; align=&#34;center&#34;>

<%
  Set MyDb=Server.CreateObject(&#34;ASP.db&#34 :Wink: 

&#39;CLIENTLIST = session(&#34;ASPDB_10271_client&#34 :Wink: 
&#39;CL = Request(&#34;CLIENTLIST&#34 :Wink: 
&#39;If CL <> &#34;CLIENTLIST&#34; then
&#39;	MyDb.dbReset(10272)
&#39;	Session(&#34;CL&#34 :Wink:  = CLIENTLIST
&#39;End If

CL = session(&#34;ASPDB_10271_client&#34 :Wink: 

  Mydb.dbDBType=&#34;SQL&#34;
  Mydb.dbdat=&#34;%%%%%%%%%%%%%%%
  MyDb.dbDSN=&#34;%%%%%%%%%%%%%%&#34;
  MyDb.dbUnit=10272
  MyDb.dbMode=&#34;grid&#34;

  sq = &#34;Select DISTINCT a# FROM SR# WHERE client = &#39;&#34; 
  sq = sq & CL
  sq = sq & &#34;&#39; ORDER BY a#&#34;
  MyDb.dbSQL=sq

  MyDb.dbSelectBox=&#34;10,<B>Activity</B>, Select Activity; #activity#&#34;
  MyDb.dbGridInc=100
  MyDb.dbGridTableTag=&#34;Border=1&#34;
  MyDb.dbNavigationItem=&#34;none&#34;
  MyDb.dbExportFlds=&#34;activity&#34;
  MyDb.dbstatusbar=false
  MyDb.dbColor = &#34;2&#34;
  MyDb.dbFormTableTag = &#34;Border=1&#34;
  MyDb.ASPdb
%>


as you can see i have tried a few thing but these reset drill down window 2 and so the wrong value is selected 

if anyone can help i would apriciate it

thanks Stuart

----------


## Frank Kwong

Always try to use a different Object variable for different modules like -

X.Property and Y.Property and not Mydb all the way !

FK


------------
Stuart Paice at 3/23/01 12:10:03 AM


i have created a drill down like the one on 
http://208.196.181.86/apps/mh-drill-down.asp
and with mine the second drill down does not load all the values if the previous load from the first drill down had fewer values. I think that the second window is holding a record count and that is why it only shows a few values. how can i get this to refresh so that all the values are loaded in the second window

my code looks like this

<%
Set MyDb = Server.CreateObject(&#34;ASP.db&#34 :Wink: 
Mydb.dbDBType=&#34;SQL&#34;

  MyDb.dbQuickProps = &#34;10271;W#;SR#;Grid;;;;SQL;100&#34;
  MyDb.dbNavigationItem=&#34;none&#34;
  MyDb.dbstatusbar=false
  MyDb.dbSQL=&#34;SELECT DISTINCT c# FROM sr#$&#34;
  MyDb.dbSelectBox=&#34;10,<B>Client Name</B>, Select Employee; #client#&#34;
  MyDb.dbColor = &#34;2&#34;
  MyDb.dbGridTableTag = &#34;Border=1&#34;
  MyDb.dbExportFlds=&#34;client&#34;

&#39;MyDb.dbReset(10272)

  MyDb.ASPdb
%>
</TD>

<TD valign=&#34;middle&#34; align=&#34;center&#34;>

<%
  Set MyDb=Server.CreateObject(&#34;ASP.db&#34 :Wink: 

&#39;CLIENTLIST = session(&#34;ASPDB_10271_client&#34 :Wink: 
&#39;CL = Request(&#34;CLIENTLIST&#34 :Wink: 
&#39;If CL <> &#34;CLIENTLIST&#34; then
&#39;	MyDb.dbReset(10272)
&#39;	Session(&#34;CL&#34 :Wink:  = CLIENTLIST
&#39;End If

CL = session(&#34;ASPDB_10271_client&#34 :Wink: 

  Mydb.dbDBType=&#34;SQL&#34;
  Mydb.dbdat=&#34;%%%%%%%%%%%%%%%
  MyDb.dbDSN=&#34;%%%%%%%%%%%%%%&#34;
  MyDb.dbUnit=10272
  MyDb.dbMode=&#34;grid&#34;

  sq = &#34;Select DISTINCT a# FROM SR# WHERE client = &#39;&#34; 
  sq = sq & CL
  sq = sq & &#34;&#39; ORDER BY a#&#34;
  MyDb.dbSQL=sq

  MyDb.dbSelectBox=&#34;10,<B>Activity</B>, Select Activity; #activity#&#34;
  MyDb.dbGridInc=100
  MyDb.dbGridTableTag=&#34;Border=1&#34;
  MyDb.dbNavigationItem=&#34;none&#34;
  MyDb.dbExportFlds=&#34;activity&#34;
  MyDb.dbstatusbar=false
  MyDb.dbColor = &#34;2&#34;
  MyDb.dbFormTableTag = &#34;Border=1&#34;
  MyDb.ASPdb
%>


as you can see i have tried a few thing but these reset drill down window 2 and so the wrong value is selected 

if anyone can help i would apriciate it

thanks Stuart

----------


## Mark

Hi Stuart,

The rule is this:

&#34;You MUST do a dbReset when and only when your SQL changes (usually due to a variable in your WHERE clause).&#34;


It looks like you started to code that but it is now all commented out. You need to get that logic working. That will take care of your problems.

Mark.




------------
Stuart Paice at 3/23/01 12:10:03 AM


i have created a drill down like the one on 
http://208.196.181.86/apps/mh-drill-down.asp
and with mine the second drill down does not load all the values if the previous load from the first drill down had fewer values. I think that the second window is holding a record count and that is why it only shows a few values. how can i get this to refresh so that all the values are loaded in the second window

my code looks like this

<%
Set MyDb = Server.CreateObject(&#34;ASP.db&#34 :Wink: 
Mydb.dbDBType=&#34;SQL&#34;

  MyDb.dbQuickProps = &#34;10271;W#;SR#;Grid;;;;SQL;100&#34;
  MyDb.dbNavigationItem=&#34;none&#34;
  MyDb.dbstatusbar=false
  MyDb.dbSQL=&#34;SELECT DISTINCT c# FROM sr#$&#34;
  MyDb.dbSelectBox=&#34;10,<B>Client Name</B>, Select Employee; #client#&#34;
  MyDb.dbColor = &#34;2&#34;
  MyDb.dbGridTableTag = &#34;Border=1&#34;
  MyDb.dbExportFlds=&#34;client&#34;

&#39;MyDb.dbReset(10272)

  MyDb.ASPdb
%>
</TD>

<TD valign=&#34;middle&#34; align=&#34;center&#34;>

<%
  Set MyDb=Server.CreateObject(&#34;ASP.db&#34 :Wink: 

&#39;CLIENTLIST = session(&#34;ASPDB_10271_client&#34 :Wink: 
&#39;CL = Request(&#34;CLIENTLIST&#34 :Wink: 
&#39;If CL <> &#34;CLIENTLIST&#34; then
&#39;	MyDb.dbReset(10272)
&#39;	Session(&#34;CL&#34 :Wink:  = CLIENTLIST
&#39;End If

CL = session(&#34;ASPDB_10271_client&#34 :Wink: 

  Mydb.dbDBType=&#34;SQL&#34;
  Mydb.dbdat=&#34;%%%%%%%%%%%%%%%
  MyDb.dbDSN=&#34;%%%%%%%%%%%%%%&#34;
  MyDb.dbUnit=10272
  MyDb.dbMode=&#34;grid&#34;

  sq = &#34;Select DISTINCT a# FROM SR# WHERE client = &#39;&#34; 
  sq = sq & CL
  sq = sq & &#34;&#39; ORDER BY a#&#34;
  MyDb.dbSQL=sq

  MyDb.dbSelectBox=&#34;10,<B>Activity</B>, Select Activity; #activity#&#34;
  MyDb.dbGridInc=100
  MyDb.dbGridTableTag=&#34;Border=1&#34;
  MyDb.dbNavigationItem=&#34;none&#34;
  MyDb.dbExportFlds=&#34;activity&#34;
  MyDb.dbstatusbar=false
  MyDb.dbColor = &#34;2&#34;
  MyDb.dbFormTableTag = &#34;Border=1&#34;
  MyDb.ASPdb
%>


as you can see i have tried a few thing but these reset drill down window 2 and so the wrong value is selected 

if anyone can help i would apriciate it

thanks Stuart

----------

