Ask a Question related to ASP Database, Design and Development.
-
Brisko #1
Duplicate value appears on page for 1 field in 1 record
This is very very strange. I have an ASP page that reads records from
a database and displays a list of them
on the screen. For some reason the FirstName field for one of the
records gets displayed twice on the screen
For Example...
0391 Richard
0392 Leonard
0395 Ken
0396 Ronnie
0397 Stefan Stefan
0340 Phil
I have checked the database and the actual value in that field in the
database is fine, the name only appears
once, so I know it's not the database.
What's more is that when you click on the persons file number it loads
another page that displayed their
information... city, age, astrological sign etc... and the name for
that one profile is being duplicated on
that page too! The code is exactly the same for each person, I just
pass the persons File number to the
details page and it loads that persons details.
To help figure out where that second name was coming from I put the
word "Test" after the first name in the
database and then I started getting "Stefan Test Stefan" whenever his
name was displayed on a webpage. Once I
realised it wasn't the database value I changed it back to the
original. I tried to do a temporary fix for
this be creating an if statement similar to the following...
IF FirstName = "Stefan Stefan" THEN
FirstName = "Stefan"
END IF
.... but that did not work! I have tried several variations on it, but
none seem to work. My theory is that
the duplicate name is getting added when the name is being
displayed... at least that would explain why none
of my if statements work. It never seems to match the value, even
when I try...
IF ucase(FirstName) = "STEFAN STEFAN"
.... I know there are no leading or trailing spaces either because I
have checked for that. I have even tried
it with a single value...
IF ucase(FirstName) = "STEFAN" THEN
.... but nothing there either, the acutal value of the FirstName field
seems to be impossible to determine. I
cannot seem to match it so I can correct it and when it's displayed it
appears twice!
It's driving me nuts and I can't make any sense out of it.
Here is some of the code if it helps...
-------------------------------------------
Set oConn=Server.CreateObject("ADODB.Connection")
oConn.Open("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" +
"M:\database\asinglealternative\asa.mdb")
strSQL = "SELECT * FROM tblContact WHERE Gender = 'MALE' AND Web =
true AND IsActive = true AND ProfileType <> 'Private'"
SET rsMember = oConn.execute (strSQL)
<HTML>
<HEAD>
<TITLE>A Single Alternative: Search Results</title>
<link type="text/css" rel="StyleSheet" href="Scripts/styles.txt">
</head>
<body topmargin="5" leftmargin="10" marginheight="5" marginwidth="10">
<TABLE cellpadding=0 cellspacing=0 border=0 width=100%>
<%IF rsMember.BOF = true OR rsMember.EOF = true THEN %>
<tr>
<td colspan=10>No Results to Display, please try <a
href="profile_search.asp"> another search</a></td>
</tr>
<%ELSE%>
<tr>
<td nowrap><b>File*#***</b></td>
<td nowrap><b>First Name***</b></td>
<td nowrap><b>Age***</b></td>
<td nowrap><b>City***</b></td>
<td nowrap><b>Status***</b></td>
</tr>
<tr>
<td bgcolor=white height=1 colspan=6></td>
</tr>
<tr>
<td height=2></td>
</tr>
<% WHILE NOT rsMember.EOF
IF UCase(rsMember("ProfileType")) = "SEMI-PRIVATE" THEN
FirstName = "Private"
ELSE
FirstName = rsMember("FirstName")
END IF
%>
<TR align='Left'>
<td nowrap><a
href="profile_view.asp?ID=<%=rsMember("FileNum")%> "><%=rsMember("FileNum")%>
</a></td>
<td nowrap style="color:#660000">*<%=FirstName%> </td>
</TR>
....
I'm really not sure where that stuff is going wrong!
Brisko Guest
-
Duplicate Record Inserts
The problem is that records are not being inserted only once. The included code is processed in a page after a form. The following 3 events randomly... -
Compare record field with another record field of samerecordset
:confused; ... but I don't know how to refer to field of next record in loop through recordset. Any ideas? Thanks, WolfShade -
Duplicate record insertion
Hi there, I have a DW insert record behaviour on a php page. If the user clicks Submit quickly multiple times, I end up with duplicate records. Any... -
MS Access SQL: duplicate record... ?SELECT INTO....?
What syntax would you use to dupe a record? Thanks! -- Scotter -
Duplicate a record in a table from a Form.
I am trying to duplicate a record within the same table. Basically I have fields that will always be the same. Field 2 and 3 will always equal... -
Chris Hohmann #2
Re: Duplicate value appears on page for 1 field in 1 record
"Brisko" <benverwey@hotmail.com> wrote in message
news:96c03c8a.0307231523.1d212db5@posting.google.c om...href="profile_view.asp?ID=<%=rsMember("FileNum")%> "><%=rsMember("FileNum> This is very very strange. I have an ASP page that reads records from
> a database and displays a list of them
>
> on the screen. For some reason the FirstName field for one of the
> records gets displayed twice on the screen
>
> For Example...
>
> 0391 Richard
> 0392 Leonard
> 0395 Ken
> 0396 Ronnie
> 0397 Stefan Stefan
> 0340 Phil
>
> I have checked the database and the actual value in that field in the
> database is fine, the name only appears
>
> once, so I know it's not the database.
>
> What's more is that when you click on the persons file number it loads
> another page that displayed their
>
> information... city, age, astrological sign etc... and the name for
> that one profile is being duplicated on
>
> that page too! The code is exactly the same for each person, I just
> pass the persons File number to the
>
> details page and it loads that persons details.
>
> To help figure out where that second name was coming from I put the
> word "Test" after the first name in the
>
> database and then I started getting "Stefan Test Stefan" whenever his
> name was displayed on a webpage. Once I
>
> realised it wasn't the database value I changed it back to the
> original. I tried to do a temporary fix for
>
> this be creating an if statement similar to the following...
>
> IF FirstName = "Stefan Stefan" THEN
> FirstName = "Stefan"
> END IF
>
> ... but that did not work! I have tried several variations on it, but
> none seem to work. My theory is that
>
> the duplicate name is getting added when the name is being
> displayed... at least that would explain why none
>
> of my if statements work. It never seems to match the value, even
> when I try...
>
> IF ucase(FirstName) = "STEFAN STEFAN"
>
> ... I know there are no leading or trailing spaces either because I
> have checked for that. I have even tried
>
> it with a single value...
>
> IF ucase(FirstName) = "STEFAN" THEN
>
> ... but nothing there either, the acutal value of the FirstName field
> seems to be impossible to determine. I
>
> cannot seem to match it so I can correct it and when it's displayed it
> appears twice!
>
> It's driving me nuts and I can't make any sense out of it.
>
> Here is some of the code if it helps...
>
> -------------------------------------------
>
> Set oConn=Server.CreateObject("ADODB.Connection")
> oConn.Open("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" +
> "M:\database\asinglealternative\asa.mdb")
>
> strSQL = "SELECT * FROM tblContact WHERE Gender = 'MALE' AND Web =
> true AND IsActive = true AND ProfileType <> 'Private'"
>
> SET rsMember = oConn.execute (strSQL)
>
> <HTML>
> <HEAD>
> <TITLE>A Single Alternative: Search Results</title>
>
> <link type="text/css" rel="StyleSheet" href="Scripts/styles.txt">
>
> </head>
>
> <body topmargin="5" leftmargin="10" marginheight="5" marginwidth="10">
>
> <TABLE cellpadding=0 cellspacing=0 border=0 width=100%>
>
>
> <%IF rsMember.BOF = true OR rsMember.EOF = true THEN %>
>
> <tr>
> <td colspan=10>No Results to Display, please try <a
> href="profile_search.asp"> another search</a></td>
> </tr>
>
> <%ELSE%>
>
> <tr>
> <td nowrap><b>File # </b></td>
> <td nowrap><b>First Name </b></td>
> <td nowrap><b>Age </b></td>
> <td nowrap><b>City </b></td>
> <td nowrap><b>Status </b></td>
> </tr>
>
> <tr>
> <td bgcolor=white height=1 colspan=6></td>
> </tr>
>
> <tr>
> <td height=2></td>
> </tr>
>
> <% WHILE NOT rsMember.EOF
>
> IF UCase(rsMember("ProfileType")) = "SEMI-PRIVATE" THEN
> FirstName = "Private"
> ELSE
> FirstName = rsMember("FirstName")
> END IF
>
> %>
>
> <TR align='Left'>
> <td nowrap><a
>
")%>Just a guess, but you may have embedded a carriage return in the name,> </a></td>
> <td nowrap style="color:#660000"> <%=FirstName%> </td>
> </TR>
>
> ...
>
>
> I'm really not sure where that stuff is going wrong!
i.e. ALT-ENTER. Try expanding the row height when viewing the datasheet.
HTH
-Chris
Chris Hohmann Guest
-
Ben Verwey #3
Re: Duplicate value appears on page for 1 field in 1 record
EXCELLENT! You nailed that one!
Apparently some of the fields got fudged during the data transfer from
the old database to the new one. When I increased the height of the
records in the database I say that some of the fields had a second line
below the one that I could see.
You totally saved my ass. The site is supposed to launch tomorrow! It
was a minor issue, but would really have bugged me.
A million thanks,
Ben
*** Sent via Developersdex [url]http://www.developersdex.com[/url] ***
Don't just participate in USENET...get rewarded for it!
Ben Verwey Guest



Reply With Quote

