Link to home
Start Free TrialLog in
Avatar of upplepop
upplepopFlag for United States of America

asked on

Recordsets not recognized

I am constantly having problems with Dreamweaver not recognizing recordsets that I have created.  

I create recordsets using the Bindings tab and they Test fine and show up in the Bindings window. However, when I try to create a Server Behavior (using the Plus sign in the Server Behavior tab), I occasionally get an error stating that I need to create a recordset.  This error happens just about every time I try to do an Update Record (yes, all my text boxes are assigned to fields) and sporatically when I try an Insert Record.

Has anyone else come across this? How can I fix this?

I am using DreamWeaver MX, version 6.1.

Here is a screenshot of an error I get. As you can see, it prompts for me to create a recordset even when one exists.
http://lennon.csufresno.edu/~bcs25/error.gif
and another one:
http://lennon.csufresno.edu/~bcs25/error2.gif
Avatar of brisctt
brisctt


What are you trying to develop in....ASP/MS Access or PHP/MySQL?

I've been using Dreamweaver MX for quite some time...mostly in PHP/MySQL.....I always create my recordsets in the server behaviors panel.  

Please post your code... cannot see all of it in the screen shot.

Avatar of upplepop

ASKER

I am developing in ASP.  The recordsets are made in either the Bindings or Server Behaviors panels.

Here is my code from a relatively simple page. In this case, I try to make a dynamic table (using the button in the Application Panel) and get instructed to add a recordset.

<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<!--#include file="Connections/MISDatabase.asp" -->
<%
Dim ActivityList
Dim ActivityList_numRows

Set ActivityList = Server.CreateObject("ADODB.Recordset")
ActivityList.ActiveConnection = MM_MISDatabase_STRING
ActivityList.Source = "SELECT * FROM Log"
ActivityList.CursorType = 0
ActivityList.CursorLocation = 2
ActivityList.LockType = 1
ActivityList.Open()

ActivityList_numRows = 0
%>
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body bgcolor="#C0C0C0">
<table width="100%" border="0" cellpadding="3" cellspacing="1" bgcolor="#000000" class="border">
  <tr>
    <td bgcolor="#C0C0C0" class="page_head"><font size="2"><strong>Blank</strong></font></td>
  </tr>
  <tr>
    <td bgcolor="#DDDDDD" class="page_minor">&nbsp; </td>
  </tr>
</table>
</body>
</html>
<%
ActivityList.Close()
Set ActivityList = Nothing
%>
What are some of the field names in the LOG table?

You are doing just about everything except displaying the recordset value, maybe that's why you are getting that notice.

See code below:  NOTICE the   <%Response.Write("Log_Id")%>   statement.  You will need to replace "Log_Id" with a valid field name from your database.



<table width="100%" border="0" cellpadding="3" cellspacing="1" bgcolor="#000000" class="border">
  <tr>
    <td bgcolor="#C0C0C0" class="page_head"><font size="2"><strong>Blank</strong></font></td>
  </tr>
  <tr>
    <td bgcolor="#DDDDDD" class="page_minor"> <%Response.Write("Log_Id")%> </td>
  </tr>
</table>
Log_Id is a field name from my database, so that's not the problem.
Anyone else have any ideas? Otherwise, I'll ask to PAQ this thread.
For anyone else who has this problem, I'll leave my workaround.

Shut down the program. Open it using the shortcut icon (not by opening a file). Close the blank document it creates and open the document you are working with. This usually resolves the problem.
ASKER CERTIFIED SOLUTION
Avatar of Lunchy
Lunchy
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial