krajes Posted February 19, 2006 Share Posted February 19, 2006 HelloI have a problem with getting a short text from my table.In topics there is a example how to read a part of a TextStream file, but I have to do it with my database. How to do it with text which is in a table in database?please help meKrajes Link to comment Share on other sites More sharing options...
Pollux Posted February 20, 2006 Share Posted February 20, 2006 To extract data from a database table rather than a textfile you need to create a connection to the database, query it using an SQL query string, and then use the recordset thats returned however you wish. You do all this using ADO, you may find the following article useful:ADO SQL QueryHopefully that covers what you needed to know! Link to comment Share on other sites More sharing options...
krajes Posted February 20, 2006 Author Share Posted February 20, 2006 Hey, I know generally how to get data from the table, and all this things. My problem was with geting a part of data, first 100 characters from the text which is in database. Solution: SELECT left(your_column_name,100)as something from ....... Link to comment Share on other sites More sharing options...
Akasha Posted February 21, 2006 Share Posted February 21, 2006 try this function ClipText(TheText, TheLength) ' Test if needed first if TheLength > 0 then if (Len(TheText) > TheLength) then TheText = Left(TheText, TheLength - 3) & "..." end if end if ClipText = TheText end function and where you want to write the tekst you enterfirst you have to load your text into a variable like summaryand specify the amount of characters you want to show <%=ClipText(summary, 300)%> for examplethis will get the first 300 charactersthe text will be finished with three dots ...i hope it will help you out Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now