mnongkhlaw
Programmer
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 :
="<A HREF=transchoice.asp?veh_type="+[veh_type]+">"+[veh_type]+"</A>"
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 :
="<A HREF=transdetails.asp?veh_type1="+[veh_type1]+">"+[veh_type1]+"</A>"
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("veh_type")
'Fix it just in case it cannot grab
if len(trim(svar))=0 then
svar="BUS"
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
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 :
="<A HREF=transchoice.asp?veh_type="+[veh_type]+">"+[veh_type]+"</A>"
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 :
="<A HREF=transdetails.asp?veh_type1="+[veh_type1]+">"+[veh_type1]+"</A>"
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("veh_type")
'Fix it just in case it cannot grab
if len(trim(svar))=0 then
svar="BUS"
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