473,561 Members | 3,803 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

MapNetworkDrive : Extremely Poor Performance When Writing to Path

Hi All,

I'm attempting to use the MapNetworkDrive <snippedbelow from entire
code below with very poor performance results.

Basically, I have very small 73kb text files that are rewritten daily
to a network share using the MapNetworkDrive command to connect to the
valid \\servername\sh are path.

After successfully connecting the drive in the ASP code, the text file
write process begins and takes more than 15 minutes to write the first
file when the asp page is executed. The process finally times out
since I have set the Server.ScriptTi meOut = 900 for testing purposes
which limits the asp page execution to 15 minutes. In that entire
time, the first file is viewable on the network share but only
partially completed. The additioanl files never complete.

I have done some troubleshooting by manually mapping the share
(outside of the ASP code) using Windows Explorer and copied the same
file that is being created in the routine from the IIS server to the
mapped drive - results are miliseconds to copy - excellent performance
this way.

Any idea of what would cause this performance hit from the looks of my
code? The server is IIS W2K3 and latest version of IIS and updates is
installed. We run many other ASP processes on the server successfully.

'<snip>

Set objNetwork = CreateObject("W Script.Network" )
'objNetwork.Rem oveNetworkDrive "M:"
strDriveLetter = "M:"
strRemotePath = "\\nad2divdb1\E _PT"
strUser = "Username"
strPassword = "Password"
strProfile = "False" ' means do not store in profile leave as false.
objNetwork.MapN etworkDrive strDriveLetter, strRemotePath, strProfile,
strUser, strPassword
' WScript.Quit

'<end snip>

Here is the entire page of code........

<html>

<head>
<title>Packag e Tracking Results - Client Feed</title>
</head>

<body>

<!-- #INCLUDE VIRTUAL="/nsceast/miscellaneous/adovbs.inc" -- <!--
Use "Virtual" rather than "File" for Virtual Path -->

<%
' set timeout for longer processing (default is 90 seconds)
Server.ScriptTi meOut = 900 ' In seconds - 300s = 5m

' define variables
dim oConn ' ADO Connection
dim oRSc ' ADO Recordset - Courier table
dim cfedexSQLstr ' SQL string - Courier table - FedEx
extraction
dim cupsSQLstr ' SQL string - Courier table - UPS
extraction
dim cdhlSQLstr ' SQL string - Courier table - DHL
extraction
dim oRSn ' ADO Recordset - NAN table
dim nSQLstr ' SQL string - NAN table
dim objFSO ' FSO Connection
dim objTextFile ' Text File
Dim i, j, tmp ' variables used for the Text File
Build process
Dim strMonth, strDay, strYear ' variables from user selection of
month/day/year
dim strDate ' variable to store complete date
dim cSwitch ' switch for Courier field(s) to
prevent extra comma when two spaces between fields occur
dim cSubSwitch ' subroutine loop switch (used to
determine clear of oRSc recordset)
dim objNetwork ' WScript drive access Connection
dim strRemotePath, strProfile, strUser, strPassword ' Additional
WScript variables

' set and open ADO connection
set oConn=Server.Cr eateObject("ADO DB.connection")
oConn.Open "DRIVER={Micros oft Access Driver (*.mdb)};DBQ=" & "c:/
Database/QaTracking/QaTracking.mdb" & ";"

' set and define FSO connection and text file object location
Set objFSO = CreateObject("S cripting.FileSy stemObject")

Set objNetwork = CreateObject("W Script.Network" )
'objNetwork.Rem oveNetworkDrive "M:"
strDriveLetter = "M:"
strRemotePath = "\\nad2divdb1\E _PT"
strUser = "Username"
strPassword = "Password"
strProfile = "False" ' means do not store in profile leave as false.
objNetwork.MapN etworkDrive strDriveLetter, strRemotePath, strProfile,
strUser, strPassword
'WScript.Quit

' Store User Month/Day/Year
strMonth = Request.QuerySt ring("Month")
strDay = Request.QuerySt ring("Day")
strYear = Request.QuerySt ring("Year")
strDate = strMonth & "/" & strDay & "/" & strYear

' SQL strings for Courier and NAN tables
cfedexSQLstr = "SELECT * FROM Courier WHERE Courier.Courier = 'Fedex'
AND Courier.Date = #" & strDate & "#"
cupsSQLstr = "SELECT * FROM Courier WHERE Courier.Courier = 'UPS' AND
Courier.Date = #" & strDate & "#"
cdhlSQLstr = "SELECT * FROM Courier WHERE Courier.Courier = 'Airborne'
AND Courier.Date = #" & strDate & "#"
nSQLstr = "SELECT * FROM NAN"

' Initial Switch values
'cSwitch = "Off"
cSubSwitch = "Off"

'************** *************** **
'//// BUILD FEDEX TEXT FILE ////
'************** *************** **
Response.Conten tType = "text/plain"
'cSwitch = "Off"
'------------------------------
'//// OPEN FEDEX RECORDSET ////
'------------------------------
set oRSc=Server.Cre ateObject("ADOD B.Recordset")
oRSc.Open cfedexSQLstr, oConn
'------------------------------
'//// OPEN FEDEX TEXT FILE ////
'------------------------------
'Set objTextFile = objFSO.CreateTe xtFile(Server.M apPath("textfil e.txt",
2))
'Response.Write (Server.MapPath ("textfile.txt" ) & "<br />")
Set objTextFile = objFSO.OpenText File("M:\FED000 .txt",2)
'--------------------------------------------
'//// CALL SUBROUTINE TO BUILD TEXT FILE ////
'--------------------------------------------
Call TextFileBuildLo op

'************** ***************
'//// BUILD UPS TEXT FILE ////
'************** ***************
Response.Conten tType = "text/plain"
'cSwitch = "Off"
'----------------------------
'//// OPEN UPS RECORDSET ////
'----------------------------
set oRSc=Server.Cre ateObject("ADOD B.Recordset")
oRSc.Open cupsSQLstr, oConn
'----------------------------
'//// OPEN UPS TEXT FILE ////
'----------------------------
'Set objTextFile =
objFSO.CreateTe xtFile(Server.M apPath("textfil e.txt"))
'Response.Write (Server.MapPath ("textfile.txt" ) & "<br />")
Set objTextFile = objFSO.OpenText File("C:\UPS000 .txt",2)
'--------------------------------------------
'//// CALL SUBROUTINE TO BUILD TEXT FILE ////
'--------------------------------------------
Call TextFileBuildLo op

'************** ***************
'//// BUILD DHL TEXT FILE ////
'************** ***************
Response.Conten tType = "text/plain"
'cSwitch = "Off"
'----------------------------
'//// OPEN DHL RECORDSET ////
'----------------------------
set oRSc=Server.Cre ateObject("ADOD B.Recordset")
oRSc.Open cdhlSQLstr, oConn
'----------------------------
'//// OPEN DHL TEXT FILE ////
'----------------------------
'Set objTextFile =
objFSO.CreateTe xtFile(Server.M apPath("textfil e.txt"))
'Response.Write (Server.MapPath ("textfile.txt" ) & "<br />")
Set objTextFile = objFSO.OpenText File("C:\DHL000 .txt",2)
'--------------------------------------------
'//// CALL SUBROUTINE TO BUILD TEXT FILE ////
'--------------------------------------------
cSubSwitch = "On"
Call TextFileBuildLo op

'************** *****
'//// SUBROUTINE////
'************** *****
SUB TextFileBuildLo op
'---------------------------------
'//// WRITE TEXT TO TEXT FILE ////
'---------------------------------
'objTextFile.Wr iteLine "This text is in the file ""textfile.txt" "!"
'------------------------------------------------------
'//// BEGIN TEXT FILE BUILDING - LOOP THROUGH ROWS ////
'------------------------------------------------------
If Not oRSc.EOF Then
'-------------------------------------------------------------
'//// THIS PART PRODUCES THE FIRST TOP ROW OF FIELD NAMES ////
'-------------------------------------------------------------
' For i = 1 To oRSc.Fields.Cou nt
' objTextFile.Wri te oRSc.Fields(i-1).Name
' If i < oRSc.Fields.Cou nt Then
' objTextFile.Wri te " "
' End If
' Next
' objTextFile.Wri teLine
' --------------------- // END // ----------------------------
While Not oRSc.EOF
For i = 1 To oRSc.Fields.Cou nt
'------------------------------------------------------
'//// THIS PART ADDS QUOTES AROUND THE FIELD VALUE ////
'------------------------------------------------------
If oRSc.Fields(i-1) <"" Then
tmp = oRSc.Fields(i-1)
' If TypeName(tmp) = "String" Then
' objTextFile.Wri te """" &_
'Replace(oRSc.F ields(i-1),vbCrLf,"""") & ""
' Else
'---------------------- // END // ---------------------
objTextFile.Wri te oRSc.Fields(i-1)
' End If
End If
' writes the space between fields
If i < oRSc.Fields.Cou nt Then
' If cSwitch = "Off" Then
objTextFile.Wri te " "
' End If
End If
' If oRSc.Fields(i-1).Name = "Track" Then
' cSwitch = "On"
' Else
' cSwitch = "Off"
' End If
' loop through fields / stay on same record
Next
' go to next line in text file / move to next record
objTextFile.Wri teLine
oRSc.MoveNext
Wend
End If
Set objTextFile = Nothing
If cSubSwitch = "Off" Then
Set oRSc = Nothing
End If
END SUB

'************** ***************
'//// BUILD NAN TEXT FILE ////
'************** ***************
Response.Conten tType = "text/plain"
'----------------------------
'//// OPEN NAN RECORDSET ////
'----------------------------
set oRSn=Server.Cre ateObject("ADOD B.Recordset")
oRSn.Open nSQLstr, oConn
'----------------------------
'//// OPEN NAN TEXT FILE ////
'----------------------------
'Set objTextFile =
objFSO.CreateTe xtFile(Server.M apPath("textfil e.txt"))
'Response.Write (Server.MapPath ("textfile.txt" ) & "<br />")
Set objTextFile = objFSO.OpenText File("C:\NAN000 .txt",2)
'---------------------------------
'//// WRITE TEXT TO TEXT FILE ////
'---------------------------------
'objTextFile.Wr iteLine "This text is in the file ""textfile.txt" "!"
'------------------------------------------------------
'//// BEGIN TEXT FILE BUILDING - LOOP THROUGH ROWS ////
'------------------------------------------------------
If Not oRSn.EOF Then
'-------------------------------------------------------------
'//// THIS PART PRODUCES THE FIRST TOP ROW OF FIELD NAMES ////
'-------------------------------------------------------------
' For i = 1 To oRSn.Fields.Cou nt
' objTextFile.Wri te oRSn.Fields(i-1).Name
' If i < oRSn.Fields.Cou nt Then
' objTextFile.Wri te " "
' End If
' Next
' objTextFile.Wri teLine
' --------------------- // END // ----------------------------
While Not oRSn.EOF
For i = 1 To oRSn.Fields.Cou nt
If oRSn.Fields(i-1) <"" Then
tmp = oRSn.Fields(i-1)
'------------------------------------------------------
'//// THIS PART ADDS QUOTES AROUND THE FIELD VALUE ////
'------------------------------------------------------
' If TypeName(tmp) = "String" Then
' objTextFile.Wri te """" &_
'Replace(oRSn.F ields(i-1),vbCrLf,"""") & ""
' Else
'---------------------- // END // ---------------------
objTextFile.Wri te oRSn.Fields(i-1)
' End If
End If
If i < oRSn.Fields.Cou nt Then
objTextFile.Wri te " "
End If
Next
objTextFile.Wri teLine
oRSn.MoveNext
Wend
End If

Dim clientIP
clientIP = Request.ServerV ariables("REMOT E_ADDR")

' define variable
dim objCDOMail
' create mail object
Set objCDOMail = Server.CreateOb ject("CDONTS.Ne wMail")
' compose message
objCDOMail.From = "CLI2-TRAINING <no*****@adp.co m>" 'this format
authors the e-mail as a name of your choice
objCDOMail.To = "CL************ @adp.com;"
objCDOMail.Cc = ""
objCDOMail.Impo rtance = 2 '(0=Low, 1=Normal, 2=High)
objCDOMail.Subj ect = "Package Tracking ADP4ME Export Notification for
" & strDate & ""
objCDOMail.Body Format = 0
objCDOMail.Mail Format = 0 ' CdoMailFormatMi me 'use for MS Outlook mail
objCDOMail.Body = "<html>" &_
"<head>" &_
"<title>Sen ding CDONTS Email Using HTML</title>" &_
"</head>" &_
"<body>" &_
"<div align=""center" ">" &_
" <center>" &_
" <table border=""1"" cellspacing=""1 ""
width=""50%"">" &_
" <tr><td width=""100%""> <p align=center><b ><font
size=""5"">Pack age Tracking ADP4ME Export Notification</font></b></p></
td></tr>" &_
" <tr><td width=""100%""> <p align=left><b>M achine
Number:</bN/A</p></td></tr>" &_
" <tr><td width=""100%""> <p align=left><b>C lient
IP:</b" & clientIP & "</p></td></tr>" &_
" <tr><td width=""100%""> <p align=left><b>D ate:</
b" & FormatDateTime( Date,vbLongDate ) & "</p></td></tr>" &_
" <tr><td width=""100%""> <p align=left><b>T ime:</
b" & FormatDateTime( Time,vbLongTime ) & "</p></td></tr>" &_
" <tr><td width=""100%""> <p
align=left><b>S tatus:</b" & strDate & " Export Completed
Successfully</p></td></tr>" &_
" </table>" &_
" </center>" &_
"</div>" &_
"</body>" &_
"</html>"
' send message
'objCDOMail.Sen d
' cleanup
Set objCDOMail = Nothing

Response.Write "<b><p align=center>Th e FedEx, UPS and DHL records for
<b>" & strDate & "</bwere processed successfully.</b></p>"
Response.Write "<p align=center>Yo u may now close this browser
window.</p>"

objTextFile.Clo se
Set objTextFile = Nothing
oRSc.Close
Set oRSc = Nothing
oRSn.Close
Set oRSn = Nothing
Set objFSO = Nothing
objNetwork.Remo veNetworkDrive strDriveLetter
Set objNetwork = Nothing
oConn.Close
Set oConn = Nothing

%>

</body>
</html>

Feb 5 '07 #1
1 3881
On Feb 5, 1:17 pm, "Billy" <UseN...@hotmai l.comwrote:
Hi All,

I'm attempting to use the MapNetworkDrive <snippedbelow from entire
code below with very poor performance results.

Basically, I have very small 73kb text files that are rewritten daily
to a network share using the MapNetworkDrive command to connect to the
valid \\servername\sh are path.

After successfully connecting the drive in the ASP code, the text file
write process begins and takes more than 15 minutes to write the first
file when the asp page is executed. The process finally times out
since I have set the Server.ScriptTi meOut = 900 for testing purposes
which limits the asp page execution to 15 minutes. In that entire
time, the first file is viewable on the network share but only
partially completed. The additioanl files never complete.

I have done some troubleshooting by manually mapping the share
(outside of the ASP code) using Windows Explorer and copied the same
file that is being created in the routine from the IIS server to the
mapped drive - results are miliseconds to copy - excellent performance
this way.

Any idea of what would cause this performance hit from the looks of my
code? The server is IIS W2K3 and latest version of IIS and updates is
installed. We run many other ASP processes on the server successfully.

'<snip>

Set objNetwork = CreateObject("W Script.Network" )
'objNetwork.Rem oveNetworkDrive "M:"
strDriveLetter = "M:"
strRemotePath = "\\nad2divdb1\E _PT"
strUser = "Username"
strPassword = "Password"
strProfile = "False" ' means do not store in profile leave as false.
objNetwork.MapN etworkDrive strDriveLetter, strRemotePath, strProfile,
strUser, strPassword
' WScript.Quit

'<end snip>

Here is the entire page of code........

<html>

<head>
<title>Packag e Tracking Results - Client Feed</title>
</head>

<body>

<!-- #INCLUDE VIRTUAL="/nsceast/miscellaneous/adovbs.inc" -- <!--
Use "Virtual" rather than "File" for Virtual Path -->

<%
' set timeout for longer processing (default is 90 seconds)
Server.ScriptTi meOut = 900 ' In seconds - 300s = 5m

' define variables
dim oConn ' ADO Connection
dim oRSc ' ADO Recordset - Courier table
dim cfedexSQLstr ' SQL string - Courier table - FedEx
extraction
dim cupsSQLstr ' SQL string - Courier table - UPS
extraction
dim cdhlSQLstr ' SQL string - Courier table - DHL
extraction
dim oRSn ' ADO Recordset - NAN table
dim nSQLstr ' SQL string - NAN table
dim objFSO ' FSO Connection
dim objTextFile ' Text File
Dim i, j, tmp ' variables used for the Text File
Build process
Dim strMonth, strDay, strYear ' variables from user selection of
month/day/year
dim strDate ' variable to store complete date
dim cSwitch ' switch for Courier field(s) to
prevent extra comma when two spaces between fields occur
dim cSubSwitch ' subroutine loop switch (used to
determine clear of oRSc recordset)
dim objNetwork ' WScript drive access Connection
dim strRemotePath, strProfile, strUser, strPassword ' Additional
WScript variables

' set and open ADO connection
set oConn=Server.Cr eateObject("ADO DB.connection")
oConn.Open "DRIVER={Micros oft Access Driver (*.mdb)};DBQ=" & "c:/
Database/QaTracking/QaTracking.mdb" & ";"

' set and define FSO connection and text file object location
Set objFSO = CreateObject("S cripting.FileSy stemObject")

Set objNetwork = CreateObject("W Script.Network" )
'objNetwork.Rem oveNetworkDrive "M:"
strDriveLetter = "M:"
strRemotePath = "\\nad2divdb1\E _PT"
strUser = "Username"
strPassword = "Password"
strProfile = "False" ' means do not store in profile leave as false.
objNetwork.MapN etworkDrive strDriveLetter, strRemotePath, strProfile,
strUser, strPassword
'WScript.Quit

' Store User Month/Day/Year
strMonth = Request.QuerySt ring("Month")
strDay = Request.QuerySt ring("Day")
strYear = Request.QuerySt ring("Year")
strDate = strMonth & "/" & strDay & "/" & strYear

' SQL strings for Courier and NAN tables
cfedexSQLstr = "SELECT * FROM Courier WHERE Courier.Courier = 'Fedex'
AND Courier.Date = #" & strDate & "#"
cupsSQLstr = "SELECT * FROM Courier WHERE Courier.Courier = 'UPS' AND
Courier.Date = #" & strDate & "#"
cdhlSQLstr = "SELECT * FROM Courier WHERE Courier.Courier = 'Airborne'
AND Courier.Date = #" & strDate & "#"
nSQLstr = "SELECT * FROM NAN"

' Initial Switch values
'cSwitch = "Off"
cSubSwitch = "Off"

'************** *************** **
'//// BUILD FEDEX TEXT FILE ////
'************** *************** **
Response.Conten tType = "text/plain"
'cSwitch = "Off"
'------------------------------
'//// OPEN FEDEX RECORDSET ////
'------------------------------
set oRSc=Server.Cre ateObject("ADOD B.Recordset")
oRSc.Open cfedexSQLstr, oConn
'------------------------------
'//// OPEN FEDEX TEXT FILE ////
'------------------------------
'Set objTextFile = objFSO.CreateTe xtFile(Server.M apPath("textfil e.txt",
2))
'Response.Write (Server.MapPath ("textfile.txt" ) & "<br />")
Set objTextFile = objFSO.OpenText File("M:\FED000 .txt",2)
'--------------------------------------------
'//// CALL SUBROUTINE TO BUILD TEXT FILE ////
'--------------------------------------------
Call TextFileBuildLo op

'************** ***************
'//// BUILD UPS TEXT FILE ////
'************** ***************
Response.Conten tType = "text/plain"
'cSwitch = "Off"
'----------------------------
'//// OPEN UPS RECORDSET ////
'----------------------------
set oRSc=Server.Cre ateObject("ADOD B.Recordset")
oRSc.Open cupsSQLstr, oConn
'----------------------------
'//// OPEN UPS TEXT FILE ////
'----------------------------
'Set objTextFile =
objFSO.CreateTe xtFile(Server.M apPath("textfil e.txt"))
'Response.Write (Server.MapPath ("textfile.txt" ) & "<br />")
Set objTextFile = objFSO.OpenText File("C:\UPS000 .txt",2)
'--------------------------------------------
'//// CALL SUBROUTINE TO BUILD TEXT FILE ////
'--------------------------------------------
Call TextFileBuildLo op

'************** ***************
'//// BUILD DHL TEXT FILE ////
'************** ***************
Response.Conten tType = "text/plain"
'cSwitch = "Off"
'----------------------------
'//// OPEN DHL RECORDSET ////
'----------------------------
set oRSc=Server.Cre ateObject("ADOD B.Recordset")
oRSc.Open cdhlSQLstr, oConn
'----------------------------
'//// OPEN DHL TEXT FILE ////
'----------------------------
'Set objTextFile =
objFSO.CreateTe xtFile(Server.M apPath("textfil e.txt"))
'Response.Write (Server.MapPath ("textfile.txt" ) & "<br />")
Set objTextFile = objFSO.OpenText File("C:\DHL000 .txt",2)
'--------------------------------------------
'//// CALL SUBROUTINE TO BUILD TEXT FILE ////
'--------------------------------------------
cSubSwitch = "On"
Call TextFileBuildLo op

'************** *****
'//// SUBROUTINE////
'************** *****
SUB TextFileBuildLo op
'---------------------------------
'//// WRITE TEXT TO TEXT FILE ////
'---------------------------------
'objTextFile.Wr iteLine "This text is in the file ""textfile.txt" "!"
'------------------------------------------------------
'//// BEGIN TEXT FILE BUILDING - LOOP THROUGH ROWS ////
'------------------------------------------------------
If Not oRSc.EOF Then
'-------------------------------------------------------------
'//// THIS PART PRODUCES THE FIRST TOP ROW OF FIELD NAMES ////
'-------------------------------------------------------------
' For i = 1 To oRSc.Fields.Cou nt
' objTextFile.Wri te oRSc.Fields(i-1).Name
' If i < oRSc.Fields.Cou nt Then
' objTextFile.Wri te " "
' End If
' Next
' objTextFile.Wri teLine
' --------------------- // END // ----------------------------
While Not oRSc.EOF
For i = 1 To oRSc.Fields.Cou nt
'------------------------------------------------------
'//// THIS PART ADDS QUOTES AROUND THE FIELD VALUE ////
'------------------------------------------------------
If oRSc.Fields(i-1) <"" Then
tmp = oRSc.Fields(i-1)
' If TypeName(tmp) = "String" Then
' objTextFile.Wri te """" &_
'Replace(oRSc.F ields(i-1),vbCrLf,"""") & ""
' Else
'---------------------- // END // ---------------------
objTextFile.Wri te oRSc.Fields(i-1)
' End If
End If
' writes the space between fields
If i < oRSc.Fields.Cou nt Then
' If cSwitch = "Off" Then
objTextFile.Wri te " "
' End If
End If
' If oRSc.Fields(i-1).Name = "Track" Then
' cSwitch = "On"
' Else
' cSwitch = "Off"
' End If
' loop through fields / stay on same record
Next
' go to next line in text file / move to next record
objTextFile.Wri teLine
oRSc.MoveNext
Wend
End If
Set objTextFile = Nothing
If cSubSwitch = "Off" Then
Set oRSc = Nothing
End If
END SUB

'************** ***************
'//// BUILD NAN TEXT FILE ////
'************** ***************
Response.Conten tType = "text/plain"
'----------------------------
'//// OPEN NAN RECORDSET ////
'----------------------------
set oRSn=Server.Cre ateObject("ADOD B.Recordset")
oRSn.Open nSQLstr, oConn
'----------------------------
'//// OPEN NAN TEXT FILE ////
'----------------------------
'Set objTextFile =
objFSO.CreateTe xtFile(Server.M apPath("textfil e.txt"))
'Response.Write (Server.MapPath ("textfile.txt" ) & "<br />")
Set objTextFile = objFSO.OpenText File("C:\NAN000 .txt",2)
'---------------------------------
'//// WRITE TEXT TO TEXT FILE ////
'---------------------------------
'objTextFile.Wr iteLine "This text is in the file ""textfile.txt" "!"
'------------------------------------------------------
'//// BEGIN TEXT FILE BUILDING - LOOP THROUGH ROWS ////
'------------------------------------------------------
If Not oRSn.EOF Then
'-------------------------------------------------------------
'//// THIS PART PRODUCES THE FIRST TOP ROW OF FIELD NAMES ////
'-------------------------------------------------------------
' For i = 1 To oRSn.Fields.Cou nt
' objTextFile.Wri te oRSn.Fields(i-1).Name
' If i < oRSn.Fields.Cou nt Then
' objTextFile.Wri te " "
' End If
' Next
' objTextFile.Wri teLine
' --------------------- // END // ----------------------------
While Not oRSn.EOF
For i = 1 To oRSn.Fields.Cou nt
If oRSn.Fields(i-1) <"" Then
tmp = oRSn.Fields(i-1)
'------------------------------------------------------
'//// THIS PART ADDS QUOTES AROUND THE FIELD VALUE ////
'------------------------------------------------------
' If TypeName(tmp) = "String" Then
' objTextFile.Wri te """" &_
'Replace(oRSn.F ields(i-1),vbCrLf,"""") & ""
' Else
'---------------------- // END // ---------------------
objTextFile.Wri te oRSn.Fields(i-1)
' End If
End If
If i < oRSn.Fields.Cou nt Then
objTextFile.Wri te " "
End If
Next
objTextFile.Wri teLine
oRSn.MoveNext
Wend
End If

Dim clientIP
clientIP = Request.ServerV ariables("REMOT E_ADDR")

' define variable
dim objCDOMail
' create mail object
Set objCDOMail = Server.CreateOb ject("CDONTS.Ne wMail")
' compose message
objCDOMail.From = "CLI2-TRAINING <nore...@adp.co m>" 'this format
authors the e-mail as a name of your choice
objCDOMail.To = "CLI2_Admin_... @adp.com;"
objCDOMail.Cc = ""
objCDOMail.Impo rtance = 2 '(0=Low, 1=Normal, 2=High)
objCDOMail.Subj ect = "Package Tracking ADP4ME Export Notification for
" & strDate & ""
objCDOMail.Body Format = 0
objCDOMail.Mail Format = 0 ' CdoMailFormatMi me 'use for MS Outlook mail
objCDOMail.Body = "<html>" &_
"<head>" &_
"<title>Sen ding CDONTS Email Using HTML</title>" &_
"</head>" &_
"<body>" &_
"<div align=""center" ">" &_
" <center>" &_
" <table border=""1"" cellspacing=""1 ""
width=""50%"">" &_
" <tr><td width=""100%""> <p align=center><b ><font
size=""5"">Pack age Tracking ADP4ME Export Notification</font></b></p></
td></tr>" &_
" <tr><td width=""100%""> <p align=left><b>M achine
Number:</bN/A</p></td></tr>" &_
" <tr><td width=""100%""> <p align=left><b>C lient
IP:</b" & clientIP & "</p></td></tr>" &_
" <tr><td width=""100%""> <p align=left><b>D ate:</
b" & FormatDateTime( Date,vbLongDate ) & "</p></td></tr>" &_
" <tr><td width=""100%""> <p align=left><b>T ime:</
b" & FormatDateTime( Time,vbLongTime ) & "</p></td></tr>" &_
" <tr><td width=""100%""> <p
align=left><b>S tatus:</b" & strDate & " Export Completed
Successfully</p></td></tr>" &_
" </table>" &_
" </center>" &_
"</div>" &_
"</body>" &_
"</html>"
' send message
'objCDOMail.Sen d
' cleanup
Set objCDOMail = Nothing

Response.Write "<b><p align=center>Th e FedEx, UPS and DHL records for
<b>" & strDate & "</bwere processed successfully.</b></p>"
Response.Write "<p align=center>Yo u may now close this browser
window.</p>"

objTextFile.Clo se
Set objTextFile = Nothing
oRSc.Close
Set oRSc = Nothing
oRSn.Close
Set oRSn = Nothing
Set objFSO = Nothing
objNetwork.Remo veNetworkDrive strDriveLetter
Set objNetwork = Nothing
oConn.Close
Set oConn = Nothing

%>

</body>
</html>
I'm going to post my own answer here since I've researched and seen
others stuck on this same problem. The issue I found was that I was
trying to *build* and process the entire file on the network share. If
you build the file locally, then copy it over with the objFileCopy
command (I think it's an FSO object) then the ASP execution is super
fast.

Feb 5 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

25
3459
by: Brian Patterson | last post by:
I have noticed in the book of words that hasattr works by calling getattr and raising an exception if no such attribute exists. If I need the value in any case, am I better off using getattr within a try statement myself, or is there some clever implementation enhancement which makes this a bad idea? i.e. should I prefer: if...
59
4380
by: kk_oop | last post by:
Hi. I wanted to use exceptions to handle error conditions in my code. I think doing that is useful, as it helps to separate "go" paths from error paths. However, a coding guideline has been presented that says "Use conventional error-handling techniques rather than exception handling for straightforward local error processing in which a...
10
399
by: Segfahlt | last post by:
I have a fairly simple C# program that just needs to open up a fixed width file, convert each record to tab delimited and append a field to the end of it. The input files are between 300M and 600M. I've tried every memory conservation trick I know in my conversion program, and a bunch I picked up from reading some of the MSDN C# blogs, but...
14
2813
by: Steve McLellan | last post by:
Hi, Sorry to repost, but this is becoming aggravating, and causing me a lot of wasted time. I've got a reasonably large mixed C++ project, and after a number of builds (but not a constant number) linking (and sometimes compiling) becomes immensely slow, and task manager shows that link.exe (or cl.exe) is barely using any processor time, but...
2
1610
by: Joel Vazquez | last post by:
Visual Basic.NET Application RunTime Crashes and Stalls Im a newbie if you could say in .NET ive been working with it the past 3 months and have done lots of things with it, without any prior knowledge. I have a few question regarding the stability of my application. I have a synchronization application that connects to a service and...
20
2092
by: John Mark Howell | last post by:
I had a customer call about some C# code they had put together that was handling some large arrays. The performance was rather poor. The C# code runs in about 22 seconds and the equivalent C++.Net code runs in 0.3 seconds. Can someone help me understand why the C# code performance is so poor? I rewote the C# code to use a single...
2
2413
by: Brian Tabios | last post by:
Hello Everyone, I have a very complex performance issue with our production database. Here's the scenario. We have a production webserver server and a development web server. Both are running SQL Server 2000. I encounted various performance issues with the production server with a particular query. It would take approximately 22 seconds...
4
2675
by: Jim Devenish | last post by:
I have converted an Access back-end to SQL Server back-end but am having some problems. The Access to Access application has been running well for some years. I have successfully copied all the data to SQL Server and linked the tables to the front end .mdb (I am not using .adp). Some queries were performing poorly so I have converted...
4
2384
by: joa2212 | last post by:
Hello everybody, I'm posting this message because I'm quiet frustrated. We just bought a software from a small software vendor. In the beginning he hosted our application on a small server at his office. I think it was a Fujitsu-Siemens x86 running debian Linux. The performance of the DSL-Line was very poor, so we decided to buy an own...
0
7647
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7859
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8088
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
6210
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5472
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5187
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3617
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3600
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1181
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.