Hi: This is the output data which is generated with i run the program

$554.13,0,$0.00,0.00%,$0.00,0.00%,Team4,FLWP,$0.00 ,$0.00,0.00%,
$555.69,2,($880.00),7.41%,$21,993.00,2.53%,Team4,F LWP,$0.00,$0.00,2.53%,
$314.94,2,($200.00),22.22%,$15,840.00,1.99%,Team4, FLWP,$0.00,$0.00,1.99%,
$1,633.76,0,$0.00,0.00%,$17,594.00,9.29%,Team4,FLW P,$0.00,$0.00,9.29%,
$4,125.19,10,($2,662.83),17.24%,$8,580.00,48.08%,T eam4,FLWP,$0.00,$0.00,48.08%,
$4,220.32,7,($2,878.34),15.56%,$6,781.00,62.24%,Te am4,FLWP,$2,189.39,$0.00,94.52%,
$2,420.68,3,($1,106.07),15.79%,$7,161.00,33.80%,Te am4,FLWP,$0.00,$0.00,33.80%,
$3,425.59,2,($503.36),10.00%,$0.00,0.00%,Team4,FLW P,$0.00,$0.00,0.00%,
$3,475.88,6,($1,954.09),12.00%,$0.00,0.00%,Team4,F LWP,$0.00,$0.00,0.00%,
$1,859.19,8,($2,442.38),27.59%,$7,130.00,26.08%,Te am4,FLWP,$9,541.72,$0.00,159.90%,
$87.35,0,$0.00,0.00%,$0.00,0.00%,Team4,FLWP,$0.00, $0.00,0.00%,
$1,923.51,2,($1,244.26),3.08%,$0.00,0.00%,Team4,FL WP,$0.00,$0.00,0.00%,
$2,522.94,0,$0.00,0.00%,$2,000.00,126.15%,Team4,FL WP,$150.00,$0.00,133.65%,

I need help in here as I am trying to convert the text file into HTML static file. First thing is where i do the change in the code so that it prints the following at the begining of the textfile

<HTML>
<HEAD>
<TITLE>Payments report</TITLE>
<STYLE>
.ReportStyle
{
COLOR: "#000000";
FONT-FAMILY: Verdana, Times, Arial;
FONT-SIZE: 10px;
LINE-HEIGHT: 13px;
TEXT-DECORATION: none
}
.HeadingStyle
{
COLOR: "#000000";
FONT-FAMILY: Verdana, Times, Arial;
FONT-SIZE: 20px;
LINE-HEIGHT: 15px;
TEXT-DECORATION: none
}
</STYLE>

</HEAD>
----------------------------------------------------------------------------------------
Private Sub Form_Load()
Export
Main = DTSTaskExecResult_Success
End Sub

Public Sub Export()
Dim DBConn
Dim RS, RCount
Dim FSO, OutStream
Dim I
Dim OutBuff
Dim Source
Dim Str
Dim Destination
Dim DT
Dim dFirstDayNextMonth 'First day of the next month

Dim fFee 'Fee amount collected this month
Dim fPmtAmt 'Postdate amount for this month and next month
Dim fPacing 'Total amount of fees collected and postdates for the current month divided by their goal
Dim sDMEndDate 'Start of the month for retrieving Debtmaster information
Dim sDMStartDate 'End date (current date) for retrieving Debtmaster information
Dim sPDEndDate 'Current month start date for postdates
Dim sPDEndDate1 'Next month start date for postdates
Dim sPDStartDate 'Current month start date for postdates
Dim sPDStartDate1 'Next month start date for postdates
sDMStartDate = "'2006-01-01'"
sDMEndDate = "'2006-01-24'"
sPDStartDate = Date
dFirstDayNextMonth = DateSerial(Year(sPDStartDate), Month(sPDStartDate) + 1, 1)
sPDEndDate = DateAdd("d", -1, dFirstDayNextMonth)

Set DBConn = CreateObject("ADODB.Connection")
DBConn.Open "ODBC; Driver=Adaptive Server Anywhere 6.0; DSN=Debtmaster; uid=dm; pwd=,,PeAches..;"

Set oConnCC = CreateObject("ADODB.Connection")
oConnCC.Open "Provider=SQLOLEDB; Data Source=OMS0222K; Initial Catalog=OMS_CREDIT_CARDS; User ID=CREDIT_CARDS_USER"

sSql = "Select DU.User_ID As Collector, Count(*) As TotalPmts, Sum(Princ_Amt+Show_Int_Amt+Show_Fee_Amt) As Gross," & _
"Sum((Princ_Amt+Show_Int_Amt+Show_Fee_Amt)-(Clt_Princ_Amt+Clt_Int_Amt+Clt_Fee_Amt)) As Fee, " & _
"Sum(Case Pmt_Code When 'BCK' Then 1.0 When 'DBK' Then 1.0 When 'NGC' Then 1.0 Else 0 End) As NGChecks," & _
"Sum(Case Pmt_Code When 'BCK' Then (Princ_Amt+Show_Int_Amt+Show_Fee_Amt) " & _
"When 'DBK' Then (Princ_Amt+Show_Int_Amt+Show_Fee_Amt) " & _
"When 'NGC' Then (Princ_Amt+Show_Int_Amt+Show_Fee_Amt) Else 0 End) As NGPmts," & _
"(Case NGChecks When 0 Then 0 Else NGChecks/TotalPmts End) As NGRate, " & _
"Goal, (Case Goal When 0 Then 0 Else Fee/Goal End) As GoalPct, Team, Off_Loc From Pmt P " & _
"Join PmtUser U On U.Pmt_ID=P.Pmt_ID Join DMUser DU On DU.User_ID=U.User_ID " & _
"Where Pmt_Date Between " & sDMStartDate & " And " & sDMEndDate & " Group By DU.User_ID, Goal, Team, Off_Loc " & _
"Order By Off_Loc, Team, DU.User_ID"
Set RS = DBConn.Execute(sSql)
Set FSO = CreateObject("Scripting.FileSystemObject")

DT = Now()
DT = Replace(Replace(Replace(DT, ":", ""), " ", "_"), "/", "")

Source = "c:\\myfiles\OMS" & DT & ".txt"

If Not RS.EOF Then
Set OutStream = FSO.CreateTextFile(Source, True)
End If

RCount = 0
Do While Not RS.EOF
If Not RS.EOF Then
If IsNull(RS.Fields("Fee")) Then
fFee = 0
Else
fFee = Trim(RS.Fields("Fee"))
End If
Else
fFee = 0
End If
Str = ""
Str = Str & FormatCurrency(fFee, 2) & ","
Str = Str & Trim(RS.Fields("NGChecks")) & ","
Str = Str & FormatCurrency(Trim(RS.Fields("NGPmts")), 2) & ","
Str = Str & FormatPercent(Trim(RS.Fields("NGRate")), 2) & ","
If IsNull(RS.Fields("Goal")) Then
fGoal = 0
Else
fGoal = RS.Fields("Goal")
End If
Str = Str & FormatCurrency(fGoal, 2) & ","
If IsNull(RS.Fields("GoalPct")) Then
fGoalPct = 0
Else
fGoalPct = RS.Fields("GoalPct")
End If

Str = Str & FormatPercent(Trim(fGoalPct), 2) & ","
Str = Str & Trim(RS.Fields("Team")) & ","
Str = Str & Trim(RS.Fields("Off_Loc")) & ","

sSql = "Select Sum([Amount]) As PDAmt From TransactionPmts Where DateToProcess" & _
" Between '" & sPDStartDate & "' And '" & sPDEndDate & "' And Status = 'Pending' And" & _
" Collector = '" & Trim(RS!Collector) & "';"

Set RS1 = oConnCC.Execute(sSql)
If Not RS1.EOF Then
If IsNull(RS1.Fields("PDAmt")) Then
fPDAmt = 0
Else
fPDAmt = Trim(RS1.Fields("PDAmt"))
End If
Else
fPDAmt = 0
End If


If CDbl(fGoal) > 0 Then
fPacing = (CDbl(fPDAmt) + CDbl(fFee)) / CDbl(fGoal)
Else
fPacing = 0
End If

Str = Str & FormatCurrency(fPDAmt, 2) & ","

sSql = "Select Sum(Amount) As PDAmt From TransactionPmts Where DateToProcess" & _
" Between '" & sPDStartDate1 & "' And '" & sPDEndDate1 & "' And Status='Pending' And " & _
" Collector= '" & Trim(RS.Fields("Collector")) & "';"
Set RS1 = oConnCC.Execute(sSql)
If Not RS1.EOF Then
If IsNull(RS1.Fields("PDAmt")) Then
fPDAmt = 0
Else
fPDAmt = Trim(RS1.Fields("PDAmt"))
End If
Else
fPDAmt = 0
End If

Str = Str & FormatCurrency(fPDAmt, 2) & ","
Str = Str & FormatPercent(Trim(fPacing), 2) & ","
OutStream.WriteLine Str
RCount = RCount + 1
RS.MoveNext
Loop

Destination = "c:\myfiles\"

If RS.RecordCount > 0 Then
FSO.CopyFile Source, Destination, True
OutStream.Close
End If

Set FSO = Nothing

UpdateDB RS, RCount, DBConn

End Sub

Public Sub UpdateDB(RS, RCount, DBConn)
'Dim UpdStr
'If RCount > 0 Then
'UpdStr = "("
'RS.MoveFirst
'Do While Not RS.EOF
' UpdStr = UpdStr & "'" & RS.Fields("Debtor_ID") & "',"
' RS.MoveNext
'Loop
'If Len(UpdStr) > 2 Then
'UpdStr = Left(UpdStr, Len(UpdStr) - 1) & ")"
'DBConn.Execute ("Update Mortgage_Leads Set Processed = '1' where debtor_id in " & UpdStr)
'End If
'End If

DBConn.Close
Set DBConn = Nothing
Set RS = Nothing
End Sub

'Function Main()
' Export
' Main = DTSTaskExecResult_Success
'End Function