Forums

This topic is locked

Changes to ASP Command Variables in Dreamweaver 8.

Posted 25 Nov 2006 14:00:48
1
has voted
25 Nov 2006 14:00:48 bill charrette posted:
Changes to ASP Command Variables in Dreamweaver 8.0.2

In the Dreamweaver 8.0.2 Updater, changes were made to the ASP code that Dreamweaver generates. One specific change is to the ASP Command server behaviors.

When you fill out the Command dialog box, Dreamweaver 8.0.2 now asks you to provide the “Type” and “Size” for the variables without any hinting or drop-down menus, so you have to know what to type in these fields. You can find all the details at the following links:

www.adobe.com/cfusion/knowledgebase/index.cfm?id=4e6b330a

msdn.microsoft.com/library/default.asp?url=/library/en-us/ado270/htm/mdcstdatatypeenum.asp


Anyway...

I have built a web application (using Dreamweaver 8.0.2, ASP VBScript and MS Access 2000 database). I have a field in one of the tables named IssueReadCount (Data Type: Number; Field Size: Long Integer). This field stores the number of times the page is read.

I added an ‘UPDATE’ ASP Command Server Behavior to the page as follows:

UPDATE tblIssues
SET IssueReadCount = IssueReadCount + 1
WHERE IssueID = MMColParam

MMColParam = Request.QueryString ("iss_id"

'Type' variable: Double (Numeric data type for MS Access, MS SQL, MySQL)
'Size' variable: -1 (Numeric, Boolean and Date/Time data types always use -1 as the size)





Dreamweaver resulting code looks like:


<% ' this is to increment the IssueReadCount in tblIssues table

Set cmdIssueReadCount = Server.CreateObject ("ADODB.Command"
cmdIssueReadCount.ActiveConnection = MM_connIssuesManager_STRING
cmdIssueReadCount.CommandText = "UPDATE tblIssues SET IssueReadCount = IssueReadCount + 1 WHERE IssueID = ? "
cmdIssueReadCount.Parameters.Append cmdIssueReadCount.CreateParameter("MMColParam", 5, 1, -1, MM_IIF(Request.QueryString("iss_id", Request.QueryString("iss_id", cmdIssueReadCount__MMColParam & "")
cmdIssueReadCount.CommandType = 1
cmdIssueReadCount.CommandTimeout = 0
cmdIssueReadCount.Prepared = true
cmdIssueReadCount.Execute()

%>


My problem is that every time the page is read the IssueReadCount is incremented by 2 (not 1 as I need).

I’ve tried just about everything I can think of and can’t get it to increment by 1. Does anyone have an idea what I’m doing wrong? Any suggestion will help.

Bill

Reply to this topic