|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
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
|
|||
|
|||
|
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!!!! |
![]() |
| Viewing: ASP Free Forums > Programming > Visual Basic Programming > Filter midstring |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
![]() |
|