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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Display Access db

Status
Not open for further replies.

NikP

Programmer
Mar 1, 2001
18
GB
Hi Peeps,

Can anyone tell me how I can display information from a database in a formatted way....
I have a dB with a memo field in it...and need to display this to an ASP ....however some records are simple sentences and others fairly detailed paragraphs which I would like to apply tabs, and spaces in ....

any suggestions ...thanks

Nik
 
First set connection to your Recordset as follows:

<%
SQL = &quot;SELECT * FROM mydatabase ORDER BY your_filed&quot;
dim myRS
Set myRS = Server.CreateObject(&quot;ADODB.Recordset&quot;)
myRS.open SQL, &quot;DSN=data&quot;
%>


then just loop thru the records in your database as follows:

<%
do while not myRS.eof
%>

------------------- Data

<%
myRS.movenext
loop
%>



Tony
:)
 
Hi.. I have no problem with this ..sorry i didnt explain myself...

i have a line in the code...

<% Response.Write &quot;<span class=tabledisp><u>Description:</u><p><span class=tabledisph>&quot; & objRS(&quot;DESCRIPT&quot;) & &quot;</span><br>&quot;%>

So the description from my dB is displayed...but...I would like to format some of this information so that it doesnt read as block text..for long descriptions..

okay..so some of the DESCRIPT in my dB are short..but some are quite long so when displayed it looks odd....like a whole black of text...but i cant simple put in <HTML> tags in coz not all descriptions are of the same length...

any one understand..thanks
nik
 
what you do is replace(description,vbcrlf,&quot;<BR>&quot;) this will change any line breaks in the description to HTML breaks. There is also a vb code for tabs that you could change to about five non-breaking spaces &quot;&-n-b-s-p-;&quot; without the &quot;-&quot;'s. There is no HTML equivalent for Tabs. Harold Blackorby
hblackorby@scoreinteractive.com
St. Louis, MO
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top