Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

BOF or EOF errors

Status
Not open for further replies.

mazdaman

Programmer
Oct 17, 2003
55
GB
Im trying to get results using the INNER JOIN in SQL below – but it just errors all the time – code ( as you can see dreamweaver produced the code) – Im a beginner

<%
Dim mem_detail
Dim mem_detail_numRows

Set mem_detail = Server.CreateObject(&quot;ADODB.Recordset&quot;)
mem_detail.ActiveConnection = MM_accountinfo_STRING
mem_detail.Source = &quot;SELECT * FROM memorial INNER JOIN reflection On memorial.memID = reflection.refID WHERE memID = &quot; + Replace(mem_detail__MMColParam, &quot;'&quot;, &quot;''&quot;) + &quot;&quot;
mem_detail.CursorType = 0
mem_detail.CursorLocation = 2
mem_detail.LockType = 1
mem_detail.Open()

mem_detail_numRows = 0
%>


The table ‘ memorial’ has records in it but ‘reflection’ has no records in it yet and I think this produces the error below – Is it a BOF EOF problem ? Can any body help - cheers


Error Type:
ADODB.Field (0x800A0BCD)
Either BOF or EOF is True, or the current record has been deleted. Requested operation requires a current record.
 
1) + to concat strings?
2) memID is a character field? then quotes arround it
3) when using more than 1 table it is more descriptiove to use a table-identifier for all field
4) mem_detail__MMColParam is a variable with a value?

mem_detail.Source = &quot;SELECT * FROM memorial &quot; &_
&quot;INNER JOIN reflection &quot; &_
&quot;ON memorial.memID = reflection.refID &quot; &_
&quot;WHERE memorial.memID = '&quot; &_
Replace(mem_detail__MMColParam, &quot;'&quot;, &quot;''&quot;) & &quot;'&quot;

hth,
Foxbox
ttmug.gif
 
If the reflection table has no records in it then the INNER JOIN will not work as it will only display records where there are matching records in both tables.

Instead of INNER JOIN try LEFT JOIN

Mighty
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top