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

changing cursor type and the difference in recordset creation - DW8 and DWMX

LEGEND ,
Aug 02, 2006 Aug 02, 2006

Copy link to clipboard

Copied

Hi,

Just bought DW8 and I noticed, looking at the code created when creating a
recordset, that they are very different:

DWMX did this:

<%
Dim rsUser__MMColParam
rsUser__MMColParam = "1"
If (Session("MM_Username") <> "") Then
rsUser__MMColParam = Session("MM_Username")
End If
%>
<%
Dim rsUser
Dim rsUser_numRows

Set rsUser = Server.CreateObject("ADODB.Recordset")
rsUser.ActiveConnection = MM_connNAME_STRING
rsUser.Source = "SELECT * FROM dbo.tblNAME WHERE afield = '" +
Replace(rsUser__MMColParam, "'", "''") + "'"
rsUser.CursorType = 0
rsUser.CursorLocation = 2
rsUser.LockType = 1
rsUser.Open()

rsUser_numRows = 0
%>

Whereas DW8 does this:

<%
Dim rsSupport__MMColParam
rsSupport__MMColParam = "1"
If (Session("MM_Username") <> "") Then
rsSupport__MMColParam = Session("MM_Username")
End If
%>
<%
Dim rsSupport
Dim rsSupport_cmd
Dim rsSupport_numRows

Set rsSupport_cmd = Server.CreateObject ("ADODB.Command")
rsSupport_cmd.ActiveConnection = MM_connNAME_STRING
rsSupport_cmd.CommandText = "SELECT * FROM dbo.tblNAME WHERE afield = '" +
Replace(rsSupport__MMColParam, "'", "''") + "'"
rsSupport_cmd.Prepared = true
rsSupport_cmd.Parameters.Append rsSupport_cmd.CreateParameter("param1", 5,
1, -1, rsSupport__MMColParam) ' adDouble

Set rsSupport = rsSupport_cmd.Execute
rsSupport_numRows = 0
%>

Problem is, we are trying to display an ntext field on our ASP page but,
using the newly created DW8 recordset, we can't seem to change the cursor
type from Forward Only to Static, which used to appear in the properties for
the recordset. Changing to Static used to solve this problem for us, but
now we're a little stumped. Hope someone can help. Thanks.

Regards
Nath.


TOPICS
Server side applications

Views

301
Translate

Report

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
Community Beginner ,
Aug 03, 2006 Aug 03, 2006

Copy link to clipboard

Copied

Nath,
I am having a similar problem with the code. Seems it appeared after the 8.0.2 upgrade on me though. See my previous post from the name Awakekats. I absolutely can not connect to a database in a folder outside of the root files and was able to before the upgrade. Before and after is the same before and after coding that happened to me:
Dim rsUser
Dim rsUser_numRows
NOW
Dim rsSupport
***Dim rsSupport_cmd***
Dim rsSupport_numRows

This line of code fails on me inside a folder:
rsSupport_cmd.ActiveConnection = MM_connNAME_STRING

I am hoping to chat with other people about the coding issue to see what could possible be going wrong for me - I am lost.

Katherine

Votes

Translate

Report

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 ,
Aug 04, 2006 Aug 04, 2006

Copy link to clipboard

Copied

LATEST
Hi Kats,

Really wish I could help, but I'm not sure I totally understand the problem
you're having.

When you say "this line of code fails on me":
rsSupport_cmd.ActiveConnection = MM_connNAME_STRING
...what error are you getting?

...I assume you also have this, or something like it, at the head of the
page:
<!--#include file="Connections/connNAME.asp" -->

...and then within the Connections folder, something similar to the
following for connNAME.asp:

<%
' FileName="Connection_ado_conn_string.htm"
' Type="ADO"
' DesigntimeType="ADO"
' HTTP="false"
' Catalog=""
' Schema=""x
MM_connNAME_STRING = "<your connection string to your database>"
%>

If I can help out, I will! :o)
Regards
Nath.

"Awakekats" <webforumsuser@macromedia.com> wrote in message
news:eauhfu$bps$1@forums.macromedia.com...
> Nath,
> I am having a similar problem with the code. Seems it appeared after the
> 8.0.2
> upgrade on me though. See my previous post from the name Awakekats. I
> absolutely can not connect to a database in a folder outside of the root
> files
> and was able to before the upgrade. Before and after is the same before
> and
> after coding that happened to me:
> Dim rsUser
> Dim rsUser_numRows
> NOW
> Dim rsSupport
> ***Dim rsSupport_cmd***
> Dim rsSupport_numRows
>
> This line of code fails on me inside a folder:
> rsSupport_cmd.ActiveConnection = MM_connNAME_STRING
>
> I am hoping to chat with other people about the coding issue to see what
> could
> possible be going wrong for me - I am lost.
>
> Katherine
>
>


Votes

Translate

Report

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