access databse

Discussion in 'ASP General' started by johnfli, Dec 9, 2003.

  1. johnfli

    johnfli Guest

    Ok, here is something strange.

    For a webpage that I have, I used to keep a list of names and email address
    in a delimited text file. Then for some reason, my host company did
    somethign and now my page can not read teh text file, but it can write to
    it. Go figure that one.

    ANyway, So I created an access database to replace teh text file and I
    imported the data straight from the Text file.

    Everythign looks good again.
    It reads all the info from teh database perfectly.
    select * from email order by fname

    I go to add another name and email address via my web page and when I go
    back to the page that lists everythign, it does not show the new entry.


    Yet, if I open my database in Access, it is there so it saved correctly.
    And if my select statement is select * from email where fname = '" John "'
    order by fname

    then it will display the newest entry
    (Which by the way is John Doe)

    ANy Idea why the new entry will not display?
     
    johnfli, Dec 9, 2003
    #1
    1. Advertising

  2. Did you hit Ctrl+Refresh when you reloaded the page? Also see
    http://www.aspfaq.com/2022

    --
    Aaron Bertrand
    SQL Server MVP
    http://www.aspfaq.com/




    "johnfli" <> wrote in message
    news:##...
    > Ok, here is something strange.
    >
    > For a webpage that I have, I used to keep a list of names and email

    address
    > in a delimited text file. Then for some reason, my host company did
    > somethign and now my page can not read teh text file, but it can write to
    > it. Go figure that one.
    >
    > ANyway, So I created an access database to replace teh text file and I
    > imported the data straight from the Text file.
    >
    > Everythign looks good again.
    > It reads all the info from teh database perfectly.
    > select * from email order by fname
    >
    > I go to add another name and email address via my web page and when I go
    > back to the page that lists everythign, it does not show the new entry.
    >
    >
    > Yet, if I open my database in Access, it is there so it saved correctly.
    > And if my select statement is select * from email where fname = '" John

    "'
    > order by fname
    >
    > then it will display the newest entry
    > (Which by the way is John Doe)
    >
    > ANy Idea why the new entry will not display?
    >
    >
     
    Aaron Bertrand [MVP], Dec 9, 2003
    #2
    1. Advertising

  3. johnfli

    Guest Guest

    Also, make sure that in your Browser you go to:
    IE ex.
    Tools
    options
    under temporary internet files click settings
    and select "check for newer version of stored pages every
    visit to the page".
    this will work.



    >-----Original Message-----
    >Did you hit Ctrl+Refresh when you reloaded the page?

    Also see
    >http://www.aspfaq.com/2022
    >
    >--
    >Aaron Bertrand
    >SQL Server MVP
    >http://www.aspfaq.com/
    >
    >
    >
    >
    >"johnfli" <> wrote in message
    >news:##...
    >> Ok, here is something strange.
    >>
    >> For a webpage that I have, I used to keep a list of

    names and email
    >address
    >> in a delimited text file. Then for some reason, my

    host company did
    >> somethign and now my page can not read teh text file,

    but it can write to
    >> it. Go figure that one.
    >>
    >> ANyway, So I created an access database to replace teh

    text file and I
    >> imported the data straight from the Text file.
    >>
    >> Everythign looks good again.
    >> It reads all the info from teh database perfectly.
    >> select * from email order by fname
    >>
    >> I go to add another name and email address via my web

    page and when I go
    >> back to the page that lists everythign, it does not

    show the new entry.
    >>
    >>
    >> Yet, if I open my database in Access, it is there so it

    saved correctly.
    >> And if my select statement is select * from email

    where fname = '" John
    >"'
    >> order by fname
    >>
    >> then it will display the newest entry
    >> (Which by the way is John Doe)
    >>
    >> ANy Idea why the new entry will not display?
    >>
    >>

    >
    >
    >.
    >
     
    Guest, Dec 9, 2003
    #3
  4. johnfli

    Johnfli Guest

    I even tried this from a differnet computer.
    So it isn't a page refresh issue.
    Also, when I have it display the record count and display the first item in
    the record, it duplicates the second to last record info twice.





    "Aaron Bertrand [MVP]" <> wrote in message
    news:...
    > Did you hit Ctrl+Refresh when you reloaded the page? Also see
    > http://www.aspfaq.com/2022
    >
    > --
    > Aaron Bertrand
    > SQL Server MVP
    > http://www.aspfaq.com/
    >
    >
    >
    >
    > "johnfli" <> wrote in message
    > news:##...
    > > Ok, here is something strange.
    > >
    > > For a webpage that I have, I used to keep a list of names and email

    > address
    > > in a delimited text file. Then for some reason, my host company did
    > > somethign and now my page can not read teh text file, but it can write

    to
    > > it. Go figure that one.
    > >
    > > ANyway, So I created an access database to replace teh text file and I
    > > imported the data straight from the Text file.
    > >
    > > Everythign looks good again.
    > > It reads all the info from teh database perfectly.
    > > select * from email order by fname
    > >
    > > I go to add another name and email address via my web page and when I go
    > > back to the page that lists everythign, it does not show the new entry.
    > >
    > >
    > > Yet, if I open my database in Access, it is there so it saved correctly.
    > > And if my select statement is select * from email where fname = '"

    John
    > "'
    > > order by fname
    > >
    > > then it will display the newest entry
    > > (Which by the way is John Doe)
    > >
    > > ANy Idea why the new entry will not display?
    > >
    > >

    >
    >
     
    Johnfli, Dec 9, 2003
    #4
  5. johnfli

    Johnfli Guest

    http://65.160.89.126/john/email/index.asp
    There are at least 110 records, but it only shows 109.


    "Aaron Bertrand [MVP]" <> wrote in message
    news:...
    > Did you hit Ctrl+Refresh when you reloaded the page? Also see
    > http://www.aspfaq.com/2022
    >
    > --
    > Aaron Bertrand
    > SQL Server MVP
    > http://www.aspfaq.com/
    >
    >
    >
    >
    > "johnfli" <> wrote in message
    > news:##...
    > > Ok, here is something strange.
    > >
    > > For a webpage that I have, I used to keep a list of names and email

    > address
    > > in a delimited text file. Then for some reason, my host company did
    > > somethign and now my page can not read teh text file, but it can write

    to
    > > it. Go figure that one.
    > >
    > > ANyway, So I created an access database to replace teh text file and I
    > > imported the data straight from the Text file.
    > >
    > > Everythign looks good again.
    > > It reads all the info from teh database perfectly.
    > > select * from email order by fname
    > >
    > > I go to add another name and email address via my web page and when I go
    > > back to the page that lists everythign, it does not show the new entry.
    > >
    > >
    > > Yet, if I open my database in Access, it is there so it saved correctly.
    > > And if my select statement is select * from email where fname = '"

    John
    > "'
    > > order by fname
    > >
    > > then it will display the newest entry
    > > (Which by the way is John Doe)
    > >
    > > ANy Idea why the new entry will not display?
    > >
    > >

    >
    >
     
    Johnfli, Dec 9, 2003
    #5
  6. > I even tried this from a differnet computer.
    > So it isn't a page refresh issue.


    Did you read the whole article I sent?

    --
    Aaron Bertrand
    SQL Server MVP
    http://www.aspfaq.com/
     
    Aaron Bertrand [MVP], Dec 9, 2003
    #6
  7. johnfli

    johnfli Guest

    Yes I read it.
    I even added the code they showed

    <%
    pStr = "private, no-cache, must-revalidate"
    Response.ExpiresAbsolute = #2000-01-01#
    Response.AddHeader "pragma", "no-cache"
    Response.AddHeader "cache-control", pStr
    %>

    I even went so far as to restart the Machine that is hosting the pages.
    Still it only shows the first 109 records.
    If I have it sort by a differnet field, it will show the newly added
    records, but then it wont show a couple of other records.




    "Aaron Bertrand [MVP]" <> wrote in message
    news:...
    > > I even tried this from a differnet computer.
    > > So it isn't a page refresh issue.

    >
    > Did you read the whole article I sent?
    >
    > --
    > Aaron Bertrand
    > SQL Server MVP
    > http://www.aspfaq.com/
    >
    >
     
    johnfli, Dec 9, 2003
    #7
  8. johnfli

    johnfli Guest

    When I do a response.write for the Record count, it tells me, 111.
    When I take out the line that says "On error resume next"
    After it displays record 109, I get an error that is complaing about EOF
    being true.

    If I sort it differently, it will list record 110 and 111, but it will leave
    out what would be the last 2 records that are in the database.





    "Aaron Bertrand [MVP]" <> wrote in message
    news:...
    > > I even tried this from a differnet computer.
    > > So it isn't a page refresh issue.

    >
    > Did you read the whole article I sent?
    >
    > --
    > Aaron Bertrand
    > SQL Server MVP
    > http://www.aspfaq.com/
    >
    >
     
    johnfli, Dec 9, 2003
    #8
  9. Instead of narrating, can you show the actual code you're talking about?

    --
    Aaron Bertrand
    SQL Server MVP
    http://www.aspfaq.com/




    "johnfli" <> wrote in message
    news:...
    > When I do a response.write for the Record count, it tells me, 111.
    > When I take out the line that says "On error resume next"
    > After it displays record 109, I get an error that is complaing about EOF
    > being true.
    >
    > If I sort it differently, it will list record 110 and 111, but it will

    leave
    > out what would be the last 2 records that are in the database.
    >
    >
    >
    >
    >
    > "Aaron Bertrand [MVP]" <> wrote in message
    > news:...
    > > > I even tried this from a differnet computer.
    > > > So it isn't a page refresh issue.

    > >
    > > Did you read the whole article I sent?
    > >
    > > --
    > > Aaron Bertrand
    > > SQL Server MVP
    > > http://www.aspfaq.com/
    > >
    > >

    >
    >
     
    Aaron Bertrand - MVP, Dec 9, 2003
    #9
  10. "johnfli" <> wrote in message
    news:...
    > When I do a response.write for the Record count, it tells me, 111.
    > When I take out the line that says "On error resume next"
    > After it displays record 109, I get an error that is complaing about

    EOF
    > being true.
    >
    > If I sort it differently, it will list record 110 and 111, but it will

    leave
    > out what would be the last 2 records that are in the database.
    >
    >
    >
    >
    >
    > "Aaron Bertrand [MVP]" <> wrote in message
    > news:...
    > > > I even tried this from a differnet computer.
    > > > So it isn't a page refresh issue.

    > >
    > > Did you read the whole article I sent?
    > >
    > > --
    > > Aaron Bertrand
    > > SQL Server MVP
    > > http://www.aspfaq.com/


    Seems to work just fine. Note, record 111 is listed as "Jane Doe".
    Similarly, record 110 is listed as "John Doe". As such, they appear in
    the middle of the list. Also, please remove record 112. That was me. ;-)

    HTH
    -Chris Hohmann
     
    Chris Hohmann, Dec 9, 2003
    #10
  11. johnfli

    johnfli Guest

    OK, here you go.
    I am just including the asp stuff as I don't think you need to see teh HTML
    junk, unless you really want to.

    This is at the very top of my asp page;

    <%@ LANGUAGE=VBSCRIPT %>
    <%
    pStr = "private, no-cache, must-revalidate"
    Response.ExpiresAbsolute = #2000-01-01#
    Response.AddHeader "pragma", "no-cache"
    Response.AddHeader "cache-control", pStr
    %>

    html stuff in here

    then;
    <%
    Dim strSortOrder
    dim objConn
    dim rsUsers
    dim strUserSQL

    strSortOrder=request("Sort")
    if trim(strSortOrder) = "" then
    strSortOrder = "FName"
    end if

    Set objConn = Server.CreateObject ("ADODB.Connection")
    Set rsUsers = Server.CreateObject ("ADODB.Recordset")

    strUserSQL = "SELECT Email.ID, Email.Fname, Email.Lname, Email.email,
    Email.year, Email.city, Email.state FROM Email order by " & strSortOrder


    objConn.Open "DSN=IVHS_Email"
    rsUsers.Open strUserSQL, objConn, 3,3

    response.write "==== " & rsUsers.Recordcount & " ====="

    strRecordCount = rsUsers.Recordcount


    If not (rsUsers.BOF and rsUsers.EOF) then
    rsUsers.movelast
    rsUsers.movefirst

    do until rsUsers.eof = true


    %>

    Then the html stuff that displays the info goes here
    then at the end is;


    <%

    rsUsers.moveNext
    loop
    end if

    %>






    "Aaron Bertrand - MVP" <> wrote in message
    news:ucw0$...
    > Instead of narrating, can you show the actual code you're talking about?
    >
    > --
    > Aaron Bertrand
    > SQL Server MVP
    > http://www.aspfaq.com/
    >
    >
    >
    >
    > "johnfli" <> wrote in message
    > news:...
    > > When I do a response.write for the Record count, it tells me, 111.
    > > When I take out the line that says "On error resume next"
    > > After it displays record 109, I get an error that is complaing about EOF
    > > being true.
    > >
    > > If I sort it differently, it will list record 110 and 111, but it will

    > leave
    > > out what would be the last 2 records that are in the database.
    > >
    > >
    > >
    > >
    > >
    > > "Aaron Bertrand [MVP]" <> wrote in message
    > > news:...
    > > > > I even tried this from a differnet computer.
    > > > > So it isn't a page refresh issue.
    > > >
    > > > Did you read the whole article I sent?
    > > >
    > > > --
    > > > Aaron Bertrand
    > > > SQL Server MVP
    > > > http://www.aspfaq.com/
    > > >
    > > >

    > >
    > >

    >
    >
     
    johnfli, Dec 10, 2003
    #11
  12. johnfli

    johnfli Guest

    When you have it sorting by first name, it lists all 112 items in order?


    "Chris Hohmann" <> wrote in message
    news:...
    > "johnfli" <> wrote in message
    > news:...
    > > When I do a response.write for the Record count, it tells me, 111.
    > > When I take out the line that says "On error resume next"
    > > After it displays record 109, I get an error that is complaing about

    > EOF
    > > being true.
    > >
    > > If I sort it differently, it will list record 110 and 111, but it will

    > leave
    > > out what would be the last 2 records that are in the database.
    > >
    > >
    > >
    > >
    > >
    > > "Aaron Bertrand [MVP]" <> wrote in message
    > > news:...
    > > > > I even tried this from a differnet computer.
    > > > > So it isn't a page refresh issue.
    > > >
    > > > Did you read the whole article I sent?
    > > >
    > > > --
    > > > Aaron Bertrand
    > > > SQL Server MVP
    > > > http://www.aspfaq.com/

    >
    > Seems to work just fine. Note, record 111 is listed as "Jane Doe".
    > Similarly, record 110 is listed as "John Doe". As such, they appear in
    > the middle of the list. Also, please remove record 112. That was me. ;-)
    >
    > HTH
    > -Chris Hohmann
    >
    >
    >
     
    johnfli, Dec 10, 2003
    #12
  13. johnfli

    johnfli Guest

    Forgot one thing;
    to get the EOF error I used

    "for intRecord = 0 to strRecordCount -1"

    in place of the "do until rsUsers.eof = true"

    Then naturally I had a "next" in place of the "loop"


    So in doing that, I would get the error when it hit rsUsers.moveNext for
    record 110


    "johnfli" <> wrote in message
    news:...
    > OK, here you go.
    > I am just including the asp stuff as I don't think you need to see teh

    HTML
    > junk, unless you really want to.
    >
    > This is at the very top of my asp page;
    >
    > <%@ LANGUAGE=VBSCRIPT %>
    > <%
    > pStr = "private, no-cache, must-revalidate"
    > Response.ExpiresAbsolute = #2000-01-01#
    > Response.AddHeader "pragma", "no-cache"
    > Response.AddHeader "cache-control", pStr
    > %>
    >
    > html stuff in here
    >
    > then;
    > <%
    > Dim strSortOrder
    > dim objConn
    > dim rsUsers
    > dim strUserSQL
    >
    > strSortOrder=request("Sort")
    > if trim(strSortOrder) = "" then
    > strSortOrder = "FName"
    > end if
    >
    > Set objConn = Server.CreateObject ("ADODB.Connection")
    > Set rsUsers = Server.CreateObject ("ADODB.Recordset")
    >
    > strUserSQL = "SELECT Email.ID, Email.Fname, Email.Lname, Email.email,
    > Email.year, Email.city, Email.state FROM Email order by " & strSortOrder
    >
    >
    > objConn.Open "DSN=IVHS_Email"
    > rsUsers.Open strUserSQL, objConn, 3,3
    >
    > response.write "==== " & rsUsers.Recordcount & " ====="
    >
    > strRecordCount = rsUsers.Recordcount
    >
    >
    > If not (rsUsers.BOF and rsUsers.EOF) then
    > rsUsers.movelast
    > rsUsers.movefirst
    >
    > do until rsUsers.eof = true
    >
    >
    > %>
    >
    > Then the html stuff that displays the info goes here
    > then at the end is;
    >
    >
    > <%
    >
    > rsUsers.moveNext
    > loop
    > end if
    >
    > %>
    >
    >
    >
    >
    >
    >
    > "Aaron Bertrand - MVP" <> wrote in message
    > news:ucw0$...
    > > Instead of narrating, can you show the actual code you're talking about?
    > >
    > > --
    > > Aaron Bertrand
    > > SQL Server MVP
    > > http://www.aspfaq.com/
    > >
    > >
    > >
    > >
    > > "johnfli" <> wrote in message
    > > news:...
    > > > When I do a response.write for the Record count, it tells me, 111.
    > > > When I take out the line that says "On error resume next"
    > > > After it displays record 109, I get an error that is complaing about

    EOF
    > > > being true.
    > > >
    > > > If I sort it differently, it will list record 110 and 111, but it will

    > > leave
    > > > out what would be the last 2 records that are in the database.
    > > >
    > > >
    > > >
    > > >
    > > >
    > > > "Aaron Bertrand [MVP]" <> wrote in message
    > > > news:...
    > > > > > I even tried this from a differnet computer.
    > > > > > So it isn't a page refresh issue.
    > > > >
    > > > > Did you read the whole article I sent?
    > > > >
    > > > > --
    > > > > Aaron Bertrand
    > > > > SQL Server MVP
    > > > > http://www.aspfaq.com/
    > > > >
    > > > >
    > > >
    > > >

    > >
    > >

    >
    >
     
    johnfli, Dec 10, 2003
    #13
  14. johnfli

    johnfli Guest

    Sorry all, I found the problem.

    It was me.

    I thought is was sorting by the ID field, but it was sorting by the First
    Name.

    So as a result, record 109's first name start with a 'V' thus meaning that
    it will always be last.

    I thank you for your assistance with me. Sorry it turned out to be an
    ignorance issue.





    "johnfli" <> wrote in message
    news:...
    > Forgot one thing;
    > to get the EOF error I used
    >
    > "for intRecord = 0 to strRecordCount -1"
    >
    > in place of the "do until rsUsers.eof = true"
    >
    > Then naturally I had a "next" in place of the "loop"
    >
    >
    > So in doing that, I would get the error when it hit rsUsers.moveNext for
    > record 110
    >
    >
    > "johnfli" <> wrote in message
    > news:...
    > > OK, here you go.
    > > I am just including the asp stuff as I don't think you need to see teh

    > HTML
    > > junk, unless you really want to.
    > >
    > > This is at the very top of my asp page;
    > >
    > > <%@ LANGUAGE=VBSCRIPT %>
    > > <%
    > > pStr = "private, no-cache, must-revalidate"
    > > Response.ExpiresAbsolute = #2000-01-01#
    > > Response.AddHeader "pragma", "no-cache"
    > > Response.AddHeader "cache-control", pStr
    > > %>
    > >
    > > html stuff in here
    > >
    > > then;
    > > <%
    > > Dim strSortOrder
    > > dim objConn
    > > dim rsUsers
    > > dim strUserSQL
    > >
    > > strSortOrder=request("Sort")
    > > if trim(strSortOrder) = "" then
    > > strSortOrder = "FName"
    > > end if
    > >
    > > Set objConn = Server.CreateObject ("ADODB.Connection")
    > > Set rsUsers = Server.CreateObject ("ADODB.Recordset")
    > >
    > > strUserSQL = "SELECT Email.ID, Email.Fname, Email.Lname, Email.email,
    > > Email.year, Email.city, Email.state FROM Email order by " & strSortOrder
    > >
    > >
    > > objConn.Open "DSN=IVHS_Email"
    > > rsUsers.Open strUserSQL, objConn, 3,3
    > >
    > > response.write "==== " & rsUsers.Recordcount & " ====="
    > >
    > > strRecordCount = rsUsers.Recordcount
    > >
    > >
    > > If not (rsUsers.BOF and rsUsers.EOF) then
    > > rsUsers.movelast
    > > rsUsers.movefirst
    > >
    > > do until rsUsers.eof = true
    > >
    > >
    > > %>
    > >
    > > Then the html stuff that displays the info goes here
    > > then at the end is;
    > >
    > >
    > > <%
    > >
    > > rsUsers.moveNext
    > > loop
    > > end if
    > >
    > > %>
    > >
    > >
    > >
    > >
    > >
    > >
    > > "Aaron Bertrand - MVP" <> wrote in message
    > > news:ucw0$...
    > > > Instead of narrating, can you show the actual code you're talking

    about?
    > > >
    > > > --
    > > > Aaron Bertrand
    > > > SQL Server MVP
    > > > http://www.aspfaq.com/
    > > >
    > > >
    > > >
    > > >
    > > > "johnfli" <> wrote in message
    > > > news:...
    > > > > When I do a response.write for the Record count, it tells me, 111.
    > > > > When I take out the line that says "On error resume next"
    > > > > After it displays record 109, I get an error that is complaing about

    > EOF
    > > > > being true.
    > > > >
    > > > > If I sort it differently, it will list record 110 and 111, but it

    will
    > > > leave
    > > > > out what would be the last 2 records that are in the database.
    > > > >
    > > > >
    > > > >
    > > > >
    > > > >
    > > > > "Aaron Bertrand [MVP]" <> wrote in message
    > > > > news:...
    > > > > > > I even tried this from a differnet computer.
    > > > > > > So it isn't a page refresh issue.
    > > > > >
    > > > > > Did you read the whole article I sent?
    > > > > >
    > > > > > --
    > > > > > Aaron Bertrand
    > > > > > SQL Server MVP
    > > > > > http://www.aspfaq.com/
    > > > > >
    > > > > >
    > > > >
    > > > >
    > > >
    > > >

    > >
    > >

    >
    >
     
    johnfli, Dec 10, 2003
    #14
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Ashish M Bhonkiya
    Replies:
    0
    Views:
    453
    Ashish M Bhonkiya
    May 5, 2004
  2. JIM.H.

    q: design a web and databse

    JIM.H., Feb 13, 2005, in forum: ASP .Net
    Replies:
    2
    Views:
    350
    John Timney \(ASP.NET MVP\)
    Feb 13, 2005
  3. Bgreer5050

    Access Databse In Web Developer

    Bgreer5050, Aug 21, 2007, in forum: ASP .Net
    Replies:
    3
    Views:
    320
    clintonG
    Aug 22, 2007
  4. Replies:
    3
    Views:
    467
    Roger Upole
    Nov 7, 2008
  5. Sunny

    open MS Access databse in Firefox

    Sunny, Oct 8, 2008, in forum: Javascript
    Replies:
    2
    Views:
    111
    The Magpie
    Oct 10, 2008
Loading...

Share This Page