database - strange behaviour of one field

B

btopenworld

I have an access database with lots of fields including a memo field called
'priecinfo'.

Everything works well, lots of data is written, but in one particular
situation, I can't get the field 'priceinfo' to write out:

1) the code below works properly except that the field 'priceinfo' doesn't
get written - replace it with any other field and it works.

If Recordset1("priceinfo") <> "" Then

Response.Write("<tr><td colspan='2' class='subhead'>PRICE AND BOOKING
INFORMATION</td></tr> <tr>")
Response.Write("<td colspan='2' class='subcont'><p class='pricing'>")
Response.Write (Recordset1("priceinfo")) '
(this line doesn't execute - the rest does)
Response.Write("</p></td> </tr>")

End If

Where there is information, the html gets written, but the record doesn't so
the 'If Then' statement is testing the record properly.



2) Write it like this and it does work this does work

<tr><td colspan='2' class='subhead'>PRICE AND BOOKING INFORMATION</td></tr>
<tr><td colspan='2' class='subcont'><p class='pricing'>
<% Response.Write (Recordset1("priceinfo")) %>
</p></td></tr>

3) Put the If Then back in and it doesn't work again

<tr><td colspan='2' class='subhead'>PRICE AND BOOKING INFORMATION</td></tr>
<tr><td colspan='2' class='subcont'><p class='pricing'>
<%
If Recordset1("priceinfo") <> "" Then
Response.Write (Recordset1("priceinfo"))
End If
%>
</p></td></tr>

I can get round it but I am intregued to know if anyone can shed light on
this.

TIA

John
 
B

btopenworld

Thanks for you interest - here are a few samples copied as suggested:
1)
2 Occupants £200/week
4 Occupants £250/week
50% reduction for 3 months rental

2)
From £150 to £475 per week

3)
Please let us send you a brochure, or visit our website.

4)
Please check our website or contact us for the latest price list and
availablity.

We ask for a deposit of 30% at the time of booking with the balance payable
one month before the start of the holiday.

5)
From £101 per week and £66 Friday to Monday for two persons

Thanks
John
 
G

Gérard Leclercq

Yes, but which text give you the error. Please repair the database first and
retry
 
M

Mark Schupp

This is an old old problem with memo fields.

Put the data into a variable first.

strPriceInfo = Recordset1("priceinfo")
If strPriceInfo <> "" Then

Response.Write("<tr><td colspan='2' class='subhead'>PRICE AND BOOKING
INFORMATION</td></tr> <tr>")
Response.Write("<td colspan='2' class='subcont'><p class='pricing'>")
Response.Write (strPriceInfo ) '


--
Mark Schupp
Head of Development
Integrity eLearning
www.ielearning.com


btopenworld said:
I have an access database with lots of fields including a memo field called
'priecinfo'.

Everything works well, lots of data is written, but in one particular
situation, I can't get the field 'priceinfo' to write out:

1) the code below works properly except that the field 'priceinfo' doesn't
get written - replace it with any other field and it works.

If Recordset1("priceinfo") <> "" Then

Response.Write("<tr><td colspan='2' class='subhead'>PRICE AND BOOKING
INFORMATION</td></tr> <tr>")
Response.Write("<td colspan='2' class='subcont'><p class='pricing'>")
Response.Write (Recordset1("priceinfo")) '
(this line doesn't execute - the rest does)
Response.Write("</p></td> </tr>")

End If

Where there is information, the html gets written, but the record doesn't so
the 'If Then' statement is testing the record properly.



2) Write it like this and it does work this does work

<tr><td colspan='2' class='subhead'>PRICE AND BOOKING
 
B

btopenworld

Every record (I tried a couple of dozen) behaved the same way - both before
and after I compacted/repaired the database. Very strange. Any further
ideas??
regards
John
 
B

btopenworld

Thanks - I'll try that. regards John


Mark Schupp said:
This is an old old problem with memo fields.

Put the data into a variable first.

strPriceInfo = Recordset1("priceinfo")



--
Mark Schupp
Head of Development
Integrity eLearning
www.ielearning.com


doesn't
 

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,769
Messages
2,569,582
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top