Solved

Dreamweaver Repeat region

Posted on 2012-04-06
16
543 Views
Last Modified: 2012-06-27
Hello
I have a page with a table to be filled by data from access.mdb

I want the table to contain data from an access table.

I tried to create a repeating region but it asks for a recordset.

A recordset already exists on the page

Please see the attached image.

Cant think what I am doing wrong but must be something!

Many thanks
John

Repeat Region
0
Comment
Question by:johnhardy
  • 9
  • 4
  • 3
16 Comments
 
LVL 70

Expert Comment

by:Jason C. Levine
ID: 37817671
Dreamweaver needs to see its own code for recordsets in order to use the built-in behaviors.  If you change the generated code at all or use custom code to make a recordset, DW may not allow you to use behaviors.

If this is all plain vanilla code, you may have to delete the WinFileCache-xxxxxxx.dat file from your configuration folder to get this to work.
0
 

Author Comment

by:johnhardy
ID: 37818595
Jason Thanks
I was using Insert Data Objects Repeat Region which did not work.

When I used Server Behaviours Repeat Region is worked OK.

Do you know the difference please?

Thanks
John
0
 

Author Comment

by:johnhardy
ID: 37818802
Thats Strange
I inserted some text and a further image because I could not get a master detail working.
Same problem.
Here is the image again.
master DetailJust one bit more ...

I am now  unable to insert a Recordset Navigation Bar.

regards

John
0
 
LVL 6

Expert Comment

by:worthyking1
ID: 37819252
My best advice is to learn to code yourself and break your dependency on DW. DW packaged code is heavy and unnecessarily complicated. For 200 or 300 lines of DW generated code I can do the same thing in 40-50 lines of code, and often less.

For example, here's a really simple table output of member from a recordset called "rs"...

      <% If DisplayMembers then %>
      <table width="800" border="0" cellspacing="0" cellpadding="4">
        <tr class="RowHeader">
          <td class="RowHeader"><div align="left"></div></td>
          <td class="RowHeader"><div align="left">Account # </div></td>
          <td class="RowHeader"><div align="left">Last name</div></td>
          <td colspan="2" class="RowHeader"><div align="left">First name</div></td>
          <td class="RowHeader">Actions</td>
        </tr>
        <%
i=0
If NOT rs.EOF then
	While NOT rs.EOF
		dbID = CInt(rs("ID"))
		MemberID = Trim(rs("MemberID"))
		LastName = Trim(rs("LastName"))
		FirstName = Trim(rs("FirstName"))
		i=i+1
%>
        <tr class="RowItem">
          <td class="RowItem"><div align="left"><%=i%>.</div></td>
          <td class="RowItem"><div align="left">&nbsp;<%=MemberID%></div></td>
          <td class="RowItem">
            <div align="left">&nbsp;<%=LastName%></div></td>
          <td colspan="2" class="RowItem"><%=FirstName%></td>
          <td class="RowItem"> <input name="DeleteMember" type="button" class="DeleteButton" value="Delete" onclick="del('<%=dbID%>')" /></td>
        </tr>
        <%
		rs.MoveNext()
	Wend
Else
%>
        <tr>
          <td colspan="2" class="body-text">No members found.</td>
          <td>&nbsp;</td>
          <td>&nbsp;</td>
          <td colspan="2">&nbsp;</td>
        </tr>
<% End If %>

Open in new window

0
 

Author Comment

by:johnhardy
ID: 37819730
Thanks for the excellent advise worthyking1.

Learning to code rather than using DW sounds rather daunting.

Where would you say is the best place to start.

On reflection I think I had a similar situation of DW playing up some few months ago and promised my self I would get another machine. I suspect the OS or DW of this one is corrupted, the new machine arrives any day so that will be interesting as well

Thanks for you trouble

John
0
 
LVL 6

Assisted Solution

by:worthyking1
worthyking1 earned 200 total points
ID: 37820155
Four Guys from Rolla are a great resource for classic ASP. They have tons of tutorials on everything from beginner to advanced. http://4guysfromrolla.com/

For a complete reference guide on objects, methods etc. I would recommend W3 Schools at http://w3schools.com/asp/default.asp

For DNS connections I would recommend http://www.connectionstrings.com/ (although the site seems to be down at the moment).

Other than that...Google :)  

In the early days what I would do is use DW to insert the initial code and then modify it myself to suit my needs. But I found that it is quicker to just hand code it as needed now.  If you keep your connection objects in an include file, then you can quickly and easily run queries and pull recordsets on your pages.  For example, I usually have a standard dbConn.asp include file that looks something like this:

<%
'Site db connection
SQL_Conn = "Driver={SQL Server};Server=(local);Dat<wbr ></wbr>abase=MyDb<wbr ></wbr>Name;uid=M<wbr ></wbr>yUserID;pw<wbr ></wbr>d=MyPasswo<wbr ></wbr>rd"
Set Con = Server.CreateObject("Adodb<wbr ></wbr>.Connectio<wbr ></wbr>n")
Con.Open SQL_Conn
	
Function CSQL(SQLCMD)
	'SQL injection stopper (replace ' with '', remove ; and -- and surround with '')
	If IsEmpty(SQLCMD) Or IsNull(SQLCMD) Then 
		CSQL = "''" 
	Else 
		CSQL = "'" & Trim(Replace(Replace(Repla<wbr ></wbr>ce(SQLCMD,<wbr ></wbr> "'", "''"), ";", ""), "--", "")) & "'"
	End If
End Function
		
Function MakeNumber(TheValue)
	'Demand a number, returns 0 if TheValue is not a number
	If TheValue <> "" And IsNumeric(TheValue) = True Then MakeNumber = TheValue Else MakeNumber = 0
End Function
	
Function KillCon()
	'Kills db connection
	If IsObject(Con) Then Set Con = Nothing
End Function
%>

Open in new window


Then to run a query on any page I just do this:

<%
SQL = "SELECT * FROM Members ORDER BY LastName, FirstName"
set rs = con.Execute(SQL)
%>

Open in new window


The code example I posted in my previous post would follow along after the above two items were done.  

To write to the DB is just as simple, like so:
<%
' Let us say you posted a form to this page with two form fields for the name and the record ID
MemberID = CInt(Request.Form("ID"))
FirstName = Trim(Request.Form("FirstName"))
LastName = Trim(Request.Form("LastName"))

SQL = "UPDATE Members SET FirstName = " & CSQL(FisrtName) & ", LastName = " & CSQL(LastName) & " WHERE ID = " & MakeNumber(MemberID)
con.Execute(SQL)
%>

Open in new window


It's really not that hard. Give it a try and see how quickly it becomes second nature :)
0
 
LVL 6

Expert Comment

by:worthyking1
ID: 37820162
Forgot to mention, at the bottom of any page that you have the include file it is a good idea to do your housekeeping by closing the connection object by calling the KillCon function with:

<% KillCon() %>
0
 
LVL 70

Accepted Solution

by:
Jason C. Levine earned 300 total points
ID: 37820567
>> I was using Insert Data Objects Repeat Region which did not work. When I used Server Behaviours Repeat Region is worked OK.

Corruption...
0
Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

 

Author Comment

by:johnhardy
ID: 37820981
I thank you both for all the help.

I would like to leave this thread open for a while so that I can let you know what happens with my new machine.
Not sure if I am clever enough to become a coder but it sounds very interesting and appealing.
0
 

Author Comment

by:johnhardy
ID: 37829479
I eventually have my PC running and creating master/detail pages went very well, that was until I tried to open the pagein DW with F12.

I was then given an error message
ADODB.Command error '800a0e7a'
Provider cannot be found. It may not be properly installed.
/lepage_bimed/Gen2Results.asp, line 9

line 8      Set rsGen2_cmd = Server.CreateObject ("ADODB.Command")
line 9      rsGen2_cmd.ActiveConnection = MM_connLepage_STRING

The connection string is as follows
Dim MM_connLepage_STRING
MM_connLepage_STRING = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\DDDDD\DDDDDD\DDDDD\glands.mdb;"
%>

I have combimation of DWcs3 and XP64bit I suspect these may not be compatible?
0
 
LVL 70

Expert Comment

by:Jason C. Levine
ID: 37829553
No, that error is all server.  Has nothing to do with DW.
0
 

Author Comment

by:johnhardy
ID: 37829620
Sorry Jason
I dont understand, "No, that error is all server"
Would you clarify a little for me please?
0
 
LVL 6

Expert Comment

by:worthyking1
ID: 37829858
Your machine is not setup to run ASP scripts. You would need to install IIS on your machine in order to f12 preview asp pages. Makes no sense to test locally though unless you are actually on your server.  Better to upload pages to production environment and test there.
0
 

Author Comment

by:johnhardy
ID: 37830229
Thanks,
In fact IIS is installed.

I found this page http://forums.adobe.com/message/4160444 and it does seem that later versions of access may cause problems.
0
 

Author Closing Comment

by:johnhardy
ID: 37831604
I think I eventually came to the conclusion that cs3 is not compatible with a 64 bit sytem.

This page seems to say it all and is a good reference for the future.

http://www.microsoft.com/windows/compatibility/windows-7/en-US/Search.aspx?l=en-us&type=Software&s=dreamweaver&os=64-bit.

Thanks you for being so helpful it has helped me a great deal.

Regards

John
0
 

Author Comment

by:johnhardy
ID: 37836933
Just to confirm I reinstalled xp32bit and DW cs3 is excellent again.
I also found I could not use access2007 with cs3 and had to revert to access2003.

To upgrade to windows7 and cs5.5 would cost over £400. these prices seem excessive for upgrades.
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Introduction The Google Maps API offers various ways to draw dynamic and static maps.  Using a combination of PHP and JavaScript, you can draw active JavaScript maps that allow pan-and-zoom in the client browser window.  You can also draw "static" …
Things That Drive Us Nuts Have you noticed the use of the reCaptcha feature at EE and other web sites?  It wants you to read and retype something that looks like this.Insanity!  It's not EE's fault - that's just the way reCaptcha works.  But it is …
In this Micro Tutorial viewers will learn how to create navigation buttons that change on rollover, using CSS (Continuation of the CSS Image Sprite tutorial) Create a parent ID for all the list items       - Specify position: absolute and display: block…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now