Link to home
Start Free TrialLog in
Avatar of johnhardy
johnhardyFlag for United Kingdom of Great Britain and Northern Ireland

asked on

Recordset not being found

I have a new page in DW MX2004
I created a recordset
If I try to create a dynamic table from the menus, a message asks me for a recordset, which is already there but seemingly not recognised.

If I place a textfield on the page and appply a repeat region SB, only one record shows. There are more records in the table.

Sounds like something fundamental is wrong.

Any Ideas please?

Avatar of Jason C. Levine
Jason C. Levine
Flag of United States of America image

Hi John,

Avatar of johnhardy


Can you create another blank asp file with nothing inside but the code to access the database, and a repeated region that spits out the database values onto the page?  If it doesn't work post the code so we can take a look.  Once that's working you see, you can tailor the rest of the page to your liking!
Its peculiar
I create the page and a recordset
I then try to use Insert > Application Objects > Dynamic Data > Dynamic Table

I then get the Set up Instructions box, Item 4 requires Create Recordset which of course I already have

If I then highlight a field in the recordset and insert it to tye page this works.

However I notice that I always now get the asp badge showing never the field name, which is what I had in the past.

The code is

<!--#include file="Connections/conn_BFSN_OLEDB.asp" -->
Dim rstest
Dim rstest_numRows

Set rstest = Server.CreateObject("ADODB.Recordset")
rstest.ActiveConnection = MM_conn_BFSN_OLEDB_STRING
rstest.Source = "SELECT * FROM Users"
rstest.CursorType = 0
rstest.CursorLocation = 2
rstest.LockType = 1

rstest_numRows = 0
Dim Repeat1__numRows
Dim Repeat1__index

Repeat1__numRows = 10
Repeat1__index = 0
rstest_numRows = rstest_numRows + Repeat1__numRows
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Untitled Document</title>

<form name="form1" method="post" action="">
While ((Repeat1__numRows <> 0) AND (NOT rstest.EOF))
  <p><%=(rstest.Fields.Item("UserLastName").Value)%> &nbsp;<%=(rstest.Fields.Item("UserFirstName").Value)%></p>
Set rstest = Nothing
Avatar of Rouchie
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
How did you learn asp from scratch?

I also still have problems in opening DW could it be I need a reinstall?
>> could it be I need a reinstall?

It's certainly an option, although back up all your sites/work before you attempt this - just in case.

>> How did you learn asp from scratch?

I began learning from books, but I have a real thirst for knowledge and little patience, so about half-way through the books I put them down and began trying to develop sites.  Of course I ran into hundreds of problems, but once your half-way there you can use Google/EE to find your answers.
When I went back to finish the books years later, I realised if I had kept reading them I would have never have had those problems after all...!

ASP however will soon become out-of-date, with the release of ASP.NET, which is much more powerful and is easier for new-starters to pick up, because it has loads of inbuilt database functionality.  If you can possibly afford to host your site on a .NET platform (a little more expensive than classic ASP), then go to the following site and watch the video tutorials for ASP.NET.  There is even a free editor available from Microsoft which I actually use now instead of Dreamweaver.
The books on classic ASP are therefore becoming hard to get because of the newer technologies that bookshops need to accomodate.

"Videos for ASP.NET 2.0 Beginners" -