Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Dreamweaver Query Optimisation

LEGEND ,
Jul 05, 2007 Jul 05, 2007
Hi,

I am looking at optimising my pages, some of my pages have 3 recordsets,
does Dreamweaver create a connection for each recordset? i.e. looking at the
code:

<%
Dim Recordset1
Dim Recordset1_cmd
Dim Recordset1_numRows

Set Recordset1_cmd = Server.CreateObject ("ADODB.Command")
Recordset1_cmd.ActiveConnection = MM_connection1_STRING
Recordset1_cmd.CommandText = "SELECT * FROM tablea"
Recordset1_cmd.Prepared = true

Set Recordset1 = Recordset1_cmd.Execute
Recordset1_numRows = 0
%>

<%
Dim Recordset2
Dim Recordset2_cmd
Dim Recordset2_numRows

Set Recordset2_cmd = Server.CreateObject ("ADODB.Command")
Recordset2_cmd.ActiveConnection = MM_connection1_STRING
Recordset2_cmd.CommandText = "SELECT * FROM tableb where someting =
'filter1' "
Recordset2_cmd.Prepared = true

Set Recordset2 = Recordset2_cmd.Execute
Recordset2_numRows = 0
%>

Is there a way to combine the recordsets to prevent using a new connection
for each?

Thanks!



TOPICS
Server side applications
324
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jul 05, 2007 Jul 05, 2007
LATEST
You could combine them as long as you set a default VALUE that would return
all the values when no value is found in a query string. In MS SQL server
you would use %.



"Alex McDermott" <webuser@mm.com> wrote in message
news:f6j0fk$bvr$1@forums.macromedia.com...
> Hi,
>
> I am looking at optimising my pages, some of my pages have 3 recordsets,
> does Dreamweaver create a connection for each recordset? i.e. looking at
> the code:
>
> <%
> Dim Recordset1
> Dim Recordset1_cmd
> Dim Recordset1_numRows
>
> Set Recordset1_cmd = Server.CreateObject ("ADODB.Command")
> Recordset1_cmd.ActiveConnection = MM_connection1_STRING
> Recordset1_cmd.CommandText = "SELECT * FROM tablea"
> Recordset1_cmd.Prepared = true
>
> Set Recordset1 = Recordset1_cmd.Execute
> Recordset1_numRows = 0
> %>
>
> <%
> Dim Recordset2
> Dim Recordset2_cmd
> Dim Recordset2_numRows
>
> Set Recordset2_cmd = Server.CreateObject ("ADODB.Command")
> Recordset2_cmd.ActiveConnection = MM_connection1_STRING
> Recordset2_cmd.CommandText = "SELECT * FROM tableb where someting =
> 'filter1' "
> Recordset2_cmd.Prepared = true
>
> Set Recordset2 = Recordset2_cmd.Execute
> Recordset2_numRows = 0
> %>
>
> Is there a way to combine the recordsets to prevent using a new connection
> for each?
>
> Thanks!
>
>
>


Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines