Memo and Text Fields Demo Writing out the data using ASP!

Contributed by
Rating: 5 stars5 stars5 stars5 stars5 stars / 4
September 01, 1999
Rate this Article:
MEH MEH++


SEARCH ASP FREE
TOOLS YOU CAN USE

advertisement
I currently was working an ASPproject that involved MEMO and TEXT Fields.  These two types of fields are the same just called different depending on what database your using.  Memo Fields is used in Access 97 and TEXT Fields (or BLOB) is used in MS-SQL 7.0.  Writing out these types of field types in ASP is different.  I hadn't worked  with them in a while until recently and discovered they can be a pain in the butt!

I thought to myself, if I'm having problems I imagine I could share this information with my site visitors.  I'm always seeing these questions in newsgroups and forums everywhere!  Well here you go look no further, here is the method I used in a recent project!  Might not be totally 100% certified perfect but, you know what it worked for me!  Enjoy its FREE

 

<%
' create conn as adodb.connection and open it
dim strconn
dim conn
dim rs
dim memofield
dim memofield2


'strconn = "Driver={SQL Server};SERVER=127.0.0.1;UID=loginid;PWD=password;DATABASE=yourdbname"
strconn = "DRIVER=Microsoft Access Driver (*.mdb);DBQ=" & Server.MapPath("text.mdb")
set conn = server.createobject("adodb.connection")
conn.open strconn
sql = "select tblMemoFields.id, tblMemoFields.FavoriteSeason, tblMemoFields.FavoriteTree, tblMemoFields.MemoField, tblMemoFields.MemoField2 from tblMemoFields"
set rs = conn.execute(sql)

%>
<html>
<head><title></title>
</head>
<body>
<table border="1" cellpadding="1">
<%
do while not rs.eof
    memofield = rs("MemoField")
    memofield2 = rs("MemoField2")
    response.write "<tr><td><b>" & rs("ID").name & "</b></td><td>" & rs("id") & "</td><td><b>" & rs("FavoriteSeason").name & "</b></td><td>" & rs("FavoriteSeason") & "</td><td><b>" & rs("FavoriteTree").name & "</b></td><td>" & rs("FavoriteTree") & "</td><td><b>MemoField #1:</b></td><td>" & memofield & "</td><td><b>MemoField #2</b></td><td>" & memofield2 & "</td></tr>"
    rs.movenext
loop
%>
</table>
</body>
</html>

blog comments powered by Disqus
DATABASE CODE ARTICLES

- Deployment of the MobiLink Synchronization M...
- MobiLink Synchronization Wizard in SQL Anywh...
- Finding Matching Records in Data Access Pages
- Using the AccessDataSource Control in VS 2005
- A Closer Look at ADO.NET: The Command Object
- A Closer Look at ADO.NET: The Connection Obj...
- Using ADO to Communicate with the Database, ...
- Code Snippets: Counting Records
- Constraints In Microsoft SQL Server 2000
- Multilingual entries into a DB and to be dis...
- Two combos, one textbox example
- ADO Recordset Paging
- SQL Server Database Creator - .NET Version
- Getting A List of Tables From SQL Server
- Discussion & Listserv Module by Mike Eck...

ASP Web Hosting ASP.Net Web Hosting Windows Web Hosting
 
 
 

ASP Free Forums 
 RSS  Tutorials RSS
 RSS  Forums RSS
 RSS  All Feeds
Site Map 
Request Media Kit
Write For Us Get Paid 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
Privacy Policy 
Support 


© 2003-2012 by Developer Shed. All rights reserved. DS Cluster 3 - Follow our Sitemap
Most Popular Topics
All ASP.Net Tutorials