Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Dreamweaver (all versions) section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old April 5th, 2006, 08:25 AM
Authorized User
 
Join Date: Apr 2006
Location: Perth, , Australia.
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Default 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
Reply With Quote
  #2 (permalink)  
Old April 5th, 2006, 04:42 PM
Imar's Avatar
Wrox Author
Points: 72,055, Level: 100
Points: 72,055, Level: 100 Points: 72,055, Level: 100 Points: 72,055, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,086
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

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
Reply With Quote
  #3 (permalink)  
Old April 6th, 2006, 07:27 AM
Authorized User
 
Join Date: Apr 2006
Location: Perth, , Australia.
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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
Reply With Quote
  #4 (permalink)  
Old April 6th, 2006, 08:55 AM
Authorized User
 
Join Date: Apr 2006
Location: Perth, , Australia.
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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

Reply With Quote
  #5 (permalink)  
Old April 6th, 2006, 02:51 PM
Imar's Avatar
Wrox Author
Points: 72,055, Level: 100
Points: 72,055, Level: 100 Points: 72,055, Level: 100 Points: 72,055, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,086
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

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
Reply With Quote
  #6 (permalink)  
Old April 7th, 2006, 06:06 AM
Authorized User
 
Join Date: Apr 2006
Location: Perth, , Australia.
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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

Reply With Quote
  #7 (permalink)  
Old April 7th, 2006, 12:12 PM
Imar's Avatar
Wrox Author
Points: 72,055, Level: 100
Points: 72,055, Level: 100 Points: 72,055, Level: 100 Points: 72,055, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,086
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

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
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
problem in e-mail structure sending data from data tiawebchd General .NET 3 May 5th, 2008 08:07 AM
Data Binding - Editing GridView Row Data desk_star BOOK: Professional ASP.NET 2.0 and Special Edition; ISBN: 978-0-7645-7610-2; ISBN: 978-0-470-04178-9 7 December 30th, 2007 11:07 AM
Transfering data from csv file to data base g_vamsi_krish ASP.NET 1.0 and 1.1 Professional 2 May 16th, 2006 11:58 PM
Binding to Filtered Data (or Data subsets) gdbjohnson C# 8 August 27th, 2004 01:59 PM



All times are GMT -4. The time now is 08:00 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.