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 wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to pass values from one Grid DTC to another?

Status
Not open for further replies.

mnongkhlaw

Programmer
Feb 22, 2002
62
IN
Dear folks,

I have an ASP page, trans.asp, in my Visual Interdev project . SOM is enabled for this page as I'm using Recordset and Grid DTCs
My Recordset DTC is named rsTrans and my Grid DTC is named grdTrans. Relevant properties of these 2 objects are given below:

1. rsTrans-Properties-General tab-SQL Statement :
select distinct veh_type from zone order by veh_type

Here zone is a table in a MS Access mdb file. The connection object is named cnnElect using OLEDB data provider

2. grdTrans-Properties-Data tab-Grid Columns-Field/Expression :
=&quot;<A HREF=transchoice.asp?veh_type=&quot;+[veh_type]+&quot;>&quot;+[veh_type]+&quot;</A>&quot;

where veh_type is a field in zone table having text values like BUS,MINI-BUS,JEEP

This page displays correctly.

Now, my other page referenced above, transchoice.asp, also has SOM enabled with one Recordset DTC named rsTransChoice and another grid DTC named grdTransChoice. Relevant properties of these 2 objects are given below:

1. rsTransChoice-Properties-General tab-Database Object=DE Commands and Object Name=cmdTest
rsTransChoice-Properties-Implementation tab-Automatically open the recordset is DISABLED

2. grdTransChoice-Properties-Data tab-Grid Columns-Field/Expression :
=&quot;<A HREF=transdetails.asp?veh_type1=&quot;+[veh_type1]+&quot;>&quot;+[veh_type1]+&quot;</A>&quot;

where veh_type1 is a field in zone table having text values like B-1,B-2,..,B-x, MB-1,MB-2,..,MB-x,J-1,J-2,...,J-x etc

My Command object (cmdTest) properties :

General tab-SQL Statement :
SELECT distinct veh_type1 from zone where trim(veh_type)=?

Parameters tab :
Parameters=Param1
Parameter Properties : Name=Param1, Direction=Input,DataType=adVarChar,Size=12,Host data type=String(VT_BSTR),Required=True

In transchoice.asp, I added a subroutine for grabbing the parameter required for the rsTransChoice recordset object as follows :-

Sub rsTransChoice_onbeforeopen()
dim svar
'Grab the veh_type send by trans.asp
svar=trim(Request.QueryString(&quot;veh_type&quot;))
'Fix it just in case it cannot grab
if len(trim(svar))=0 then
svar=&quot;BUS&quot;
end if
rsTransChoice.setParameter 0,svar
rsTransChoice.open
End Sub


When I view the trans.asp page and click on the grdTrans hyperlinked column names which appear like BUS,JEEP,TRUCK etc.
(hovering the mouse pointer over them, they appear like in status bar of browser),
the page then takes me to transchoice.asp, but alas! I get a blank page with no errors and no grdTransChoice where I can again click to
take me to transdetails.asp!

I apologise for my long post, but I hope that it will help someone to help me out.

Mark Nongkhlaw
mark@shillong.meg.nic.in
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top