p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   Dreamweaver (all versions) (http://p2p.wrox.com/forumdisplay.php?f=58)
-   -   Can't see my data (http://p2p.wrox.com/showthread.php?t=40826)

Mike707 April 5th, 2006 08:25 AM

Can't see my data
 
OK, this is driving me crazy!:( I've created a DW MX 2004 (Windows XP Pro, SP2) page with some fields selected from a recordset I've created from an Access 2003 database. All of this looks OK and I can see everything as expected in Application > Databases. I can also see my data in the View Data option. But, when I Save the page and then go to Preview in Browser, I can't see my data. Everything else is there, ie the page static text, but my data is missing in action. I've checked the security settings on just about my whole computer to make sure that IUSR_machinename is authorised to the folders and database (and it's folder) but nothing . . . I've been trying to fix this for the best part of two weeks (in my spare time!) and am now totally out of ideas. I've also looked through this forum to page 16 and can't see this problem mentioned, which makes me think it must be something pretty stupid:( If anyone has any ideas, I'd be really grateful.

Thanks very much,
Mike
Perth, Australia

Imar April 5th, 2006 04:42 PM

Hi Mike,

Do you preview on localhost? That is, do you test and develop on the same machine?

Can you describe your setup a little, and maybe show us some code and your connection string?
Just to rule out security setting, did you try granting Everyone full control to the folder with the database?

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
Author of ASP.NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004

Mike707 April 6th, 2006 07:27 AM

Hi Imar,

Yes, I do preview on the localhost and have found that I need to specify port 8500 to get the pages to display in the browser (IE6) as follows: - http://localhost:8500/barlows/

Also, I have given Everyone full access as you suggested but still no data. The page code is as follows:

 <%@LANGUAGE="VBSCRIPT"%>

<%
Dim Recordset1
Dim Recordset1_numRows

Set Recordset1 = Server.CreateObject("ADODB.Recordset")
Recordset1.ActiveConnection = MM_barlows_STRING
Recordset1.Source = "SELECT * FROM Contacts"
Recordset1.CursorType = 0
Recordset1.CursorLocation = 2
Recordset1.LockType = 1
Recordset1.Open()

Recordset1_numRows = 0
%>
<%
' *** Recordset Stats, Move To Record, and Go To Record: declare stats variables

Dim Recordset1_total
Dim Recordset1_first
Dim Recordset1_last

' set the record count
Recordset1_total = Recordset1.RecordCount

' set the number of rows displayed on this page
If (Recordset1_numRows < 0) Then
  Recordset1_numRows = Recordset1_total
Elseif (Recordset1_numRows = 0) Then
  Recordset1_numRows = 1
End If

' set the first and last displayed record
Recordset1_first = 1
Recordset1_last = Recordset1_first + Recordset1_numRows - 1

' if we have the correct record count, check the other stats
If (Recordset1_total <> -1) Then
  If (Recordset1_first > Recordset1_total) Then
    Recordset1_first = Recordset1_total
  End If
  If (Recordset1_last > Recordset1_total) Then
    Recordset1_last = Recordset1_total
  End If
  If (Recordset1_numRows > Recordset1_total) Then
    Recordset1_numRows = Recordset1_total
  End If
End If
%>

<%
' *** Recordset Stats: if we don't know the record count, manually count them

If (Recordset1_total = -1) Then

  ' count the total records by iterating through the recordset
  Recordset1_total=0
  While (Not Recordset1.EOF)
    Recordset1_total = Recordset1_total + 1
    Recordset1.MoveNext
  Wend

  ' reset the cursor to the beginning
  If (Recordset1.CursorType > 0) Then
    Recordset1.MoveFirst
  Else
    Recordset1.Requery
  End If

  ' set the number of rows displayed on this page
  If (Recordset1_numRows < 0 Or Recordset1_numRows > Recordset1_total) Then
    Recordset1_numRows = Recordset1_total
  End If

  ' set the first and last displayed record
  Recordset1_first = 1
  Recordset1_last = Recordset1_first + Recordset1_numRows - 1

  If (Recordset1_first > Recordset1_total) Then
    Recordset1_first = Recordset1_total
  End If
  If (Recordset1_last > Recordset1_total) Then
    Recordset1_last = Recordset1_total
  End If

End If
%><style type="text/css">
<!--
body,td,th,p {
    color: #FF0000;
    font-family: Verdana, Arial, Helvetica, sans-serif;
    font-size: 12px;
    font-style: normal;
    line-height: normal;
    font-weight: normal;
    font-variant: normal;
    text-transform: none;
    text-decoration: underline;
}
-->
</style>
<form name="form1" method="post" action="">
  <%=(Recordset1.Fields.Item("FirstName").Value)%>
  <input name="textfield" type="text" value="<%= Abs((Recordset1.Fields.Item("FirstName").Value)) %>">
</form>
<p>&nbsp;</p>
 <p>A Z R </p>
 <p>B <%=(Recordset1_total)%> </p>

 <%
Recordset1.Close()
Set Recordset1 = Nothing
%>

Basically, there's just some junk text (so that I can change it to verify that I'm looking at the latest version of the page in my browser), and some fields from my database:- firstname and recordset total. I've also added a dynamic text field (just in case I needed it) as part of my testing process.

My connection string is as follows and is taken from the Connections > barlows.asp file:-

<%
' FileName="Connection_odbc_conn_dsn.htm"
' Type="ADO"
' DesigntimeType="ADO"
' HTTP="false"
' Catalog=""
' Schema=""
Dim MM_barlows_STRING
MM_barlows_STRING = "dsn=barlows;"
%>

My Access 2003 database is called Barlowsdb and is in the Databases folder. Both the folder and the database objects (the database application and the Access.lockfile.9) have Everyone with Full Control authority. The DSN setup says Dreamweaver should connect using local DSN.

Under IIS, I have Default Web Site and then (amongst others) the wwwroot and Databases folders.

Not sure what else you might need to know . . . As mentioned previously, the test DSN connection and view data both work fine within DW, its just that I don't see the data when I go via Preview in Browser or if I just type in the URL manually.

Hope you can help Imar!

Best regards,

Mike

Mike707 April 6th, 2006 08:55 AM

Imar,

I fixed it!! I created a brand new site, connected to the same database, added a couple of fields - and bingo, there was my data! I then compared the HTML code with my oroginal site and made the two the same. With a bit of fiddling around, I got it to work!! Sooooo, the HTML in the original page must have got corrupted somehow. My guess is that with all of the chopping and changing I did, something didn't get deleted correctly and messed things up.

Now, I do have another question, but I'm going to put that in a new post, so maybe you can read that and help me there.

Thanks a lot Imar, I really appreciate you trying to help me. In reality, it was following up on your reply that got me to the answer, so thank-you.

Regards,

Mike


Imar April 6th, 2006 02:51 PM

Hi Mike,

Great. Glad it's working.

You may want to take a look here: http://www.connectionstrings.com/ under the Access section for a better connection string. Using DSNs are not always the best way, although if you're using an ISP, they're often the only way to connect to a database....

Cheers,

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
Author of ASP.NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004

Mike707 April 7th, 2006 06:06 AM

Thanks Imar, I'll have a look. Ultimately, the intention is to run the site from a hosted location, so a DSN sounds like my only real option.

Regards,

Mike


Imar April 7th, 2006 12:12 PM

It all really depends on the ISP. Some allow only DSNs, other allow other type of connection strings.

Fortunately, switching the connection string is as simple as changing the single connection include file.

Cheers,

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
Author of ASP.NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004


All times are GMT -4. The time now is 09:43 AM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.