HighDots Forums  

return a sql query

Macromedia Dreamweaver Macromedia Dreamweaver Discussions (macromedia.dreamweaver)


Discuss return a sql query in the Macromedia Dreamweaver forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Gm3512
 
Posts: n/a

Default return a sql query - 05-01-2005 , 06:07 PM






i have a table that returns information from a record set. This works fine. I
have one field on the table that needs to return a query from another record
set/query. I am not sure how to do this. Help would be great please.

This is a small part of the table.

<tr class="frm_field">
<td><div align="center">
<input name="update_leaseinfo" type="checkbox" id="update_leaseinfo"
value="<%=(rs_termdata.Fields.Item("termID").Value )%>">
</div></td>
<td><%=(rs_termdata.Fields.Item("termName").Value) %>&nbsp;</td>
<td><%=(rs_termdata.Fields.Item("storeNumeric").Va lue)%>&nbsp;</td>
<td><%=(rs_termdata.Fields.Item("termID").Value)%> &nbsp;</td>
<td><%=(rs_termdata.Fields.Item("status").Value)%> &nbsp;</td>
<td><%=(rs_termdata.Fields.Item("termType").Value) %>&nbsp;</td>


This is the query that I want to have in the line that contains termType.


<%
Dim rs_termDesc
Dim rs_termDesc_numRows

Set rs_termDesc = Server.CreateObject("ADODB.Recordset")
rs_termDesc.ActiveConnection = MM_cn_STRING
rs_termDesc.Source = "SELECT TerminalData.termType,
TerminalTypeDesc.description, TerminalTypeDesc.manufacturer,
TerminalTypeDesc.modelNumber FROM TerminalData INNER JOIN
TerminalTypeDesc ON TerminalData.termType = TerminalTypeDesc.code"
rs_termDesc.CursorType = 0
rs_termDesc.CursorLocation = 2
rs_termDesc.LockType = 1
rs_termDesc.Open()

rs_termDesc_numRows = 0
%>


TIA
Greg


Reply With Quote
  #2  
Old   
Lionstone
 
Posts: n/a

Default Re: return a sql query - 05-02-2005 , 10:02 AM






Do a google search for "{Your database} Data Shaping".
i.e., "SQL Server Data Shaping"

It's pretty easy to pick up. It does require work on your part to get the
display right since DW doesn't support shaped recordsets, but it's not hard.


"Gm3512" <webforumsuser (AT) macromedia (DOT) com> wrote

Quote:
i have a table that returns information from a record set. This works fine.
I
have one field on the table that needs to return a query from another
record
set/query. I am not sure how to do this. Help would be great please.

This is a small part of the table.

tr class="frm_field"
td><div align="center"
input name="update_leaseinfo" type="checkbox"
id="update_leaseinfo"
value="<%=(rs_termdata.Fields.Item("termID").Value )%>"
/div></td
td><%=(rs_termdata.Fields.Item("termName").Value)% >&nbsp;</td
td><%=(rs_termdata.Fields.Item("storeNumeric").Val ue)%>&nbsp;</td
td><%=(rs_termdata.Fields.Item("termID").Value)%>& nbsp;</td
td><%=(rs_termdata.Fields.Item("status").Value)%>& nbsp;</td
td><%=(rs_termdata.Fields.Item("termType").Value)% >&nbsp;</td


This is the query that I want to have in the line that contains termType.


%
Dim rs_termDesc
Dim rs_termDesc_numRows

Set rs_termDesc = Server.CreateObject("ADODB.Recordset")
rs_termDesc.ActiveConnection = MM_cn_STRING
rs_termDesc.Source = "SELECT TerminalData.termType,
TerminalTypeDesc.description, TerminalTypeDesc.manufacturer,
TerminalTypeDesc.modelNumber FROM TerminalData INNER JOIN
TerminalTypeDesc ON TerminalData.termType =
TerminalTypeDesc.code"
rs_termDesc.CursorType = 0
rs_termDesc.CursorLocation = 2
rs_termDesc.LockType = 1
rs_termDesc.Open()

rs_termDesc_numRows = 0
%


TIA
Greg




Reply With Quote
Reply




Thread Tools
Display Modes

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.