Pretty Basic

LittLe3Lue

Active member
Joined
Mar 7, 2003
Messages
27
Read a lot of tutorials, but none that i can find that tell me how to output a certain Feild from a record.

I use Record.Find to find the record, and i want to get a particular feild, without looping through all checking for x.name each time. Anyway to just say, response.write(currentrecord.ThisFeild.Value)

Also, i am getting errors with my Find at times, i was wondering, if i get to my last found record, and there are no more after it, will it return EOF or give me an error.

For example, if i look for a company name, the 3rd last record is that, then it looks for the next matching record, and no more exist, will it just return EOF?
 
Code:
<table>
<tr>
<td colspan="11" align="center">
<font size="3">
<%
response.write("Alpha")
Main.Find("Wing=Alpha Leader",1)
response.write("<br>Wing Leader: " & Name.Value) Name.Value -> see above post for what im tryign to do here.
%>
</font></td></tr>
<%Main.MoveFirst%>
<%
do until Main.EOF
Main.Find("Wing=Alpha")
%>
<tr>
<%for each x in Main.Fields%>
<td align="center">
<%
if x.Name="Name" then
response.write(x.Value)
elseif x.Name="Games" then

...

end if
%>
</td>
<%next%>
</tr>
<%loop%>
</table>

Now here are me problems, first off, i get a:

Microsoft JET Database Engine (0x80040E29)
Rowset does not support scrolling backward.

error at my first find.
If i play aroumd, i get other errors, and finally, i came up with this, even tho it was NOT the way the tutorial said it should be written:

Code:
<table>
<tr>
<td colspan="11" align="center">
<font size="3">
<%
response.write("Alpha")
Main.Find(Wing="Alpha Leader")
response.write("<br>Wing Leader: " & Name.Value) Name.Value -> see above post for what im tryign to do here.
%>
</font></td></tr>
<%Main.MoveFirst%>
<%
do until Main.EOF
Call Main.Find(Wing="Alpha", 1)
%>
<tr>
<%for each x in Main.Fields%>
<td align="center">
<%
if x.Name="Name" then
response.write(x.Value)
elseif x.Name="Games" then

...

end if
%>
</td>
<%next%>
</tr>
<%loop%>
</table>

Now in this case, all the syntax seems to be correct, but i get this error:

ADODB.Recordset (0x800A0BB9)
Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another.

Also at the first Find.
There is a wing feild with a value of Alpha Leader for sure int he database under the first record. I have set Main.MoveFirst just in case, and same error, so it should pick up the first record.

I dont know how to use find and i have played aroudn with it for a while now.
 
Oh yeah, in case u dont catch the small change, its in the parenthesis of the Find.

The tutorial said to use parenthesis over the whole thing, but i get an error about my parenthesis. The added ", 1" in the second find simply skips one record for next search, so i dont return same result, unless it automatically does, i will have to check once it works.
 
From Microsofts site, i figured out that the correct format is actually,

Main.Find = "Wing=Alpha"

and so forth.

But now i get the initial error again, does now support scrolling backwards, or what not. I confused.
 
Seeing as how no one has helped, i would Just like to ask,

Is there any way to search to a specific record?
I can use AddRow to make an array, but without looping thorugh it all is there an easier way
 
Back
Top