access databse

J

johnfli

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?
 
G

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.
 
J

Johnfli

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.
 
J

johnfli

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.
 
J

johnfli

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.
 
C

Chris Hohmann

johnfli said:
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.

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
 
J

johnfli

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

%>
 
J

johnfli

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
 
J

johnfli

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.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,904
Latest member
HealthyVisionsCBDPrice

Latest Threads

Top