Visual Basic Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsProgrammingVisual Basic Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
Ajax Application Generator Generate database and reporting .NET Web apps in minutes. Quickly create visually stunning, feature-rich apps that are easy to customize and ready to deploy. Download Now!
  #1  
Old December 3rd, 2004, 03:37 PM
retropost retropost is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Dec 2004
Posts: 5 retropost User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Question HELP! Filter midstring with VB in SQL DTS Pkg

We have project descriptions stored with html code and body text in the same field in SQL. Using a SQL DTS package, we dump this field into Access nightly. We want to delete the html code from the beginning and end of this field during the transformation (using VB) before it is dumped to Access. Or it could work the other way (extract the text between the known html characters.) We know which character the opening html ends with and which character it starts html back up with after the text we need. When we insert the VB code into the DTS package, it runs continously and never finishes. We end up having to end the process altogether. Here's the code we are trying to insert into an "ActiveX transformation step" within a DTS package:

Function StripHTML(tmpString)
' Look for the <body > tag
i = 1
Do While Mid(tmpString, i, 9) <> "font face"
i = i + 1
Loop
' i is now at the beginning of '<body >'
' now look for the '>'
Do While Mid(tmpString, i, 1) <> ">"
i = i + 1
Loop
' Now look for '</font>'
j = i
Do While Mid(tmpString, j, 7) <> "</font>"
j = j + 1
Loop

StripHTML = Mid(tmpString, i + 1, j - i - 1)
End Function


The existing DTS package script (before adding this code) looks like this:

'************************************************* *********************
' Visual Basic Transformation Script
'************************************************* ***********************
' Copy each source column to the destination column
Function Main()
DTSDestination("DE_PROJECT_DESCRIPTION_TEXT") = DTSSource("Description")
Main = DTSTransformStat_OK
End Function


Thanks a lot for the help!!!!

Reply With Quote
Reply

Viewing: ASP Free ForumsProgrammingVisual Basic Programming > Filter midstring


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 

Iron Speed




© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway