Question
DW CS3 vs DW8 Recordset code.
I have recently loaded DW CS3 and find that if I edit a
recordset it replaces the code, it generated by Dreamweaver 8 with
new code that does not work. The new code will only allow the
display of each field once, if I then attempt to display it again
in the page there is a null value.
The code below is for a page using DW 8 record set. (I have removed much that should be there normally to keep the debug simple)
<%@LANGUAGE="VBSCRIPT"%>
<!--#include file="Connections/test.asp" -->
<%
Dim faqs
Dim faqs_numRows
Set faqs = Server.CreateObject("ADODB.Recordset")
faqs.ActiveConnection = MM_test_STRING
faqs.Source = "SELECT * FROM faq ORDER BY Popularity DESC"
faqs.CursorType = 2
faqs.CursorLocation = 2
faqs.LockType = 3
faqs.Open()
faqs_numRows = 0
%>
<html>
<head>
</head>
<body>
<p><%=(faqs.Fields.Item("Question").Value)%> / <%=(faqs.Fields.Item("Popularity").Value)%></p>
<p><%=(faqs.Fields.Item("Question").Value)%></p>
</body>
</html>
<%
faqs.Close()
Set faqs = Nothing
%>
This page shows the faq question followed by a forward slash and its' popularity and then shows the question again on a second line.
The code below is for a page using DW CS3 record set.
<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<!--#include file="Connections/test.asp" -->
<%
Dim faqs
Dim faqs_cmd
Dim faqs_numRows
Set faqs_cmd = Server.CreateObject ("ADODB.Command")
faqs_cmd.ActiveConnection = MM_test_STRING
faqs_cmd.CommandText = "SELECT * FROM faq ORDER BY Popularity DESC"
faqs_cmd.Prepared = true
Set faqs = faqs_cmd.Execute
faqs_numRows = 0
%>
<html>
<head>
</head>
<body>
<p><%=(faqs.Fields.Item("Question").Value)%> / <%=(faqs.Fields.Item("Popularity").Value)%></p>
<p><%=(faqs.Fields.Item("Question").Value)%></p>
</body>
</html>
<%
faqs.Close()
Set faqs = Nothing
%>
Despite the body content being identical when I view the page the second question is missing.
They are on the same XP Pro system/site using the same Access database.
Can anyone spot the error please?
The code below is for a page using DW 8 record set. (I have removed much that should be there normally to keep the debug simple)
<%@LANGUAGE="VBSCRIPT"%>
<!--#include file="Connections/test.asp" -->
<%
Dim faqs
Dim faqs_numRows
Set faqs = Server.CreateObject("ADODB.Recordset")
faqs.ActiveConnection = MM_test_STRING
faqs.Source = "SELECT * FROM faq ORDER BY Popularity DESC"
faqs.CursorType = 2
faqs.CursorLocation = 2
faqs.LockType = 3
faqs.Open()
faqs_numRows = 0
%>
<html>
<head>
</head>
<body>
<p><%=(faqs.Fields.Item("Question").Value)%> / <%=(faqs.Fields.Item("Popularity").Value)%></p>
<p><%=(faqs.Fields.Item("Question").Value)%></p>
</body>
</html>
<%
faqs.Close()
Set faqs = Nothing
%>
This page shows the faq question followed by a forward slash and its' popularity and then shows the question again on a second line.
The code below is for a page using DW CS3 record set.
<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<!--#include file="Connections/test.asp" -->
<%
Dim faqs
Dim faqs_cmd
Dim faqs_numRows
Set faqs_cmd = Server.CreateObject ("ADODB.Command")
faqs_cmd.ActiveConnection = MM_test_STRING
faqs_cmd.CommandText = "SELECT * FROM faq ORDER BY Popularity DESC"
faqs_cmd.Prepared = true
Set faqs = faqs_cmd.Execute
faqs_numRows = 0
%>
<html>
<head>
</head>
<body>
<p><%=(faqs.Fields.Item("Question").Value)%> / <%=(faqs.Fields.Item("Popularity").Value)%></p>
<p><%=(faqs.Fields.Item("Question").Value)%></p>
</body>
</html>
<%
faqs.Close()
Set faqs = Nothing
%>
Despite the body content being identical when I view the page the second question is missing.
They are on the same XP Pro system/site using the same Access database.
Can anyone spot the error please?
