Hi all, thanks for your help in advance.
I have a page that creates a .CSV file that has been migrated over to
Windows Server 2003 from Windows 2000 Server. It worked fine before I
moved it, but now when it creates the .CSV file, and you open it, the
first row opens in cell A1 and the second row opens in cell A2.
If you open the file in Notepad, and copy and paste the date into a new
document and save it as a .CSV, it opens fine.
Here's my code...., and I'll paste the contents of my resulting file at
the end of this.
fname = "csv\loan" + request.Form("lid") + ".csv"
fname2 = "loan" + request.Form("lid") + ".csv"
Set filetxt =
filesys.CreateTextFile(Server.MapPath(fname), 2, True)
strQuery = "SELECT * FROM vwSendLoan WHERE nUserUID = "
+ request.Form("uid")
Set rs = dbConn.Execute(strQuery)
if not rs.EOF then
FirstName = rs.Fields("cFirstName")
MiddleName = rs.Fields("cMiddleName")
LastName = rs.Fields("cLastName")
else
end if
filetxt.Write
"nUserUID,Employer_Partner_PID,First_Name,Middle_N ame,Last_Name,Name_Suffix,"
+ _
"SSN,Password,Email,Primary_Phone,Home_Address1,Ho me_Address2,Home_City,Home_State,Home_Zip,"
+ _
"DL_Number,DL_State,Source_Of_Funds,Business_Phone ,Business_Ext,Business_Fax,Business_Address1,"
+ _
"Business_Address2,Business_City,Business_State,Bu siness_Zip,Employer,Occupation,Employment_Length,R ef_Name1,Ref_Num1,"
+ _
"Ref_Relation1,Ref_Name2,Ref_Num2,Ref_Relation2,Re f_Name3,Ref_Num3,Ref_Relation3,Bank_Name,"
+ _
"Bank_Address,Bank_City,Bank_State,Bank_Zip,Routin g_Number,Manager_Phone,Manager_Name,Account_Number ,"
+ _
"Is_Confirmed,Status,Last_IP,Pay_Period,Confirmati on,Referred_By,Lead_Source,Birth_Date,"
+ _
"PayDay1,PayDay2,PayDay3,Account_Date,Last_Login,S alary,Over_Payment,MonthsAtResidence,Own_Home,"
+ _
"Number_Of_Transactions,Total_NSFs,Ending_Statemen t_Balance,Payroll_Garnishment,Months_At_Bank,NSF2, "
+ _
"NSF6,Check_Number_Used,PasswordReset,ExistingCust omer,Docs_Received,Direct_Deposit,Selected,Add_Dat e,"
+ _
"Add_User_UID,Updated_Date,Updated_User_UID,Ho ld"
filetxt.WriteLine
strWrite = ""
i = 1
for each item in rs.Fields
if(i = 8) then
strWrite = strWrite +
Left(rs.Fields("cLastName"),4) + Right(rs.Fields("cSSN"),4) + ","
elseif(i = 79) then
strWrite = strWrite + ","
elseif(item = "--Non") then
strWrite = strWrite + ","
else
if(not isNull(item)) then
if(InStr(CStr(item),",") <> 0)
then
strWrite = strWrite +
"""" + Trim(CStr(item)) + ""","
else
strWrite = strWrite +
Trim(CStr(item)) + ","
end if
else
strWrite = strWrite + ","
end if
end if
i = i + 1
next
strWrite = Left(strWrite,Len(strWrite)-1)
filetxt.Write(strWrite)
filetxt.WriteLine
filetxt.Close
Here's the contents of my resulting file. Again, if I PASTE this into
a fresh notepad document, and save it as a .CSV, it works.
nUserUID,Employer_Partner_PID,First_Name,Middle_Na me,Last_Name,Name_Suffix,SSN,Password,Email,Primar y_Phone,Home_Address1,Home_Address2,Home_City,Home _State,Home_Zip,DL_Number,DL_State,Source_Of_Funds ,Business_Phone,Business_Ext,Business_Fax,Business _Address1,Business_Address2,Business_City,Business _State,Business_Zip,Employer,Occupation,Employment _Length,Ref_Name1,Ref_Num1,Ref_Relation1,Ref_Name2 ,Ref_Num2,Ref_Relation2,Ref_Name3,Ref_Num3,Ref_Rel ation3,Bank_Name,Bank_Address,Bank_City,Bank_State ,Bank_Zip,Routing_Number,Manager_Phone,Manager_Nam e,Account_Number,Is_Confirmed,Status,Last_IP,Pay_P eriod,Confirmation,Referred_By,Lead_Source,Birth_D ate,PayDay1,PayDay2,PayDay3,Account_Date,Last_Logi n,Salary,Over_Payment,MonthsAtResidence,Own_Home,N umber_Of_Transactions,Total_NSFs,Ending_Statement_ Balance,Payroll_Garnishment,Months_At_Bank,NSF2,NS F6,Check_Number_Used,PasswordReset,ExistingCustome r,Docs_Received,Direct_Deposit,Selected,Add_Date,A dd_User_UID,Updated_Date,Updated_User_UID,Hold
66015,,Trevor,,Albrecht,--
Non,123-23-1234,Albr1234,su*****@trevnet.net,1231231234,1234 My
Street,,ORange,CA,92869,ca12323745,CA,Checking,555-555-5555,,,adefdf,adfd,adsfdf,CA,34879,Cashtrax,vp
operta,123,Friend 1,555-555-5555,sadfdf,Friend
2,444-444-4444,adfd,Friend 3,333-333-3333,adfdf,KEYPOINT CREDIT
UNION,505 N MATHILDA
AVE,SUNNYVALE,CA,94086,321180515,,,123456789,False ,R,,1ST AND
15TH,,,Google,4/11/2006,4/14/2006,5/1/2006,5/15/2006,4/10/2006 11:52:52
AM,4/10/2006 11:39:25
AM,1234,,123,True,,,,False,123,,,1234,False,False, False,False,False,4/6/2006
12:42:45 PM,,4/10/2006 11:36:42 AM,66015,False
Thanks again, everyone!!! 6 3746
"timstu" <ti****@gmail.com> wrote in message
news:11**********************@v46g2000cwv.googlegr oups.com... Hi all, thanks for your help in advance.
I have a page that creates a .CSV file that has been migrated over to Windows Server 2003 from Windows 2000 Server. It worked fine before I moved it, but now when it creates the .CSV file, and you open it, the first row opens in cell A1 and the second row opens in cell A2.
If you open the file in Notepad, and copy and paste the date into a new document and save it as a .CSV, it opens fine.
Here's my code...., and I'll paste the contents of my resulting file at the end of this.
fname = "csv\loan" + request.Form("lid") + ".csv" fname2 = "loan" + request.Form("lid") + ".csv" Set filetxt = filesys.CreateTextFile(Server.MapPath(fname), 2, True) strQuery = "SELECT * FROM vwSendLoan WHERE nUserUID = " + request.Form("uid") Set rs = dbConn.Execute(strQuery)
if not rs.EOF then FirstName = rs.Fields("cFirstName") MiddleName = rs.Fields("cMiddleName") LastName = rs.Fields("cLastName") else end if
filetxt.Write
"nUserUID,Employer_Partner_PID,First_Name,Middle_N ame,Last_Name,Name_Suffix,
" + _
"SSN,Password,Email,Primary_Phone,Home_Address1,Ho me_Address2,Home_City,Home
_State,Home_Zip," + _
"DL_Number,DL_State,Source_Of_Funds,Business_Phone ,Business_Ext,Business_Fax
,Business_Address1," + _
"Business_Address2,Business_City,Business_State,Bu siness_Zip,Employer,Occupa
tion,Employment_Length,Ref_Name1,Ref_Num1," + _
"Ref_Relation1,Ref_Name2,Ref_Num2,Ref_Relation2,Re f_Name3,Ref_Num3,Ref_Relat
ion3,Bank_Name," + _
"Bank_Address,Bank_City,Bank_State,Bank_Zip,Routin g_Number,Manager_Phone,Man
ager_Name,Account_Number," + _
"Is_Confirmed,Status,Last_IP,Pay_Period,Confirmati on,Referred_By,Lead_Source
,Birth_Date," + _
"PayDay1,PayDay2,PayDay3,Account_Date,Last_Login,S alary,Over_Payment,MonthsA
tResidence,Own_Home," + _
"Number_Of_Transactions,Total_NSFs,Ending_Statemen t_Balance,Payroll_Garnishm
ent,Months_At_Bank,NSF2," + _
"NSF6,Check_Number_Used,PasswordReset,ExistingCust omer,Docs_Received,Direct_
Deposit,Selected,Add_Date," + _
"Add_User_UID,Updated_Date,Updated_User_UID,Ho ld" filetxt.WriteLine strWrite = "" i = 1 for each item in rs.Fields if(i = 8) then strWrite = strWrite + Left(rs.Fields("cLastName"),4) + Right(rs.Fields("cSSN"),4) + "," elseif(i = 79) then strWrite = strWrite + "," elseif(item = "--Non") then strWrite = strWrite + "," else if(not isNull(item)) then if(InStr(CStr(item),",") <> 0) then strWrite = strWrite + """" + Trim(CStr(item)) + """," else strWrite = strWrite + Trim(CStr(item)) + "," end if else strWrite = strWrite + "," end if end if i = i + 1 next
strWrite = Left(strWrite,Len(strWrite)-1) filetxt.Write(strWrite) filetxt.WriteLine filetxt.Close
Here's the contents of my resulting file. Again, if I PASTE this into a fresh notepad document, and save it as a .CSV, it works.
nUserUID,Employer_Partner_PID,First_Name,Middle_Na me,Last_Name,Name_Suffix,S
SN,Password,Email,Primary_Phone,Home_Address1,Home _Address2,Home_City,Home_S
tate,Home_Zip,DL_Number,DL_State,Source_Of_Funds,B usiness_Phone,Business_Ext
,Business_Fax,Business_Address1,Business_Address2, Business_City,Business_Sta
te,Business_Zip,Employer,Occupation,Employment_Len gth,Ref_Name1,Ref_Num1,Ref
_Relation1,Ref_Name2,Ref_Num2,Ref_Relation2,Ref_Na me3,Ref_Num3,Ref_Relation3
,Bank_Name,Bank_Address,Bank_City,Bank_State,Bank_ Zip,Routing_Number,Manager
_Phone,Manager_Name,Account_Number,Is_Confirmed,St atus,Last_IP,Pay_Period,Co
nfirmation,Referred_By,Lead_Source,Birth_Date,PayD ay1,PayDay2,PayDay3,Accoun
t_Date,Last_Login,Salary,Over_Payment,MonthsAtResi dence,Own_Home,Number_Of_T
ransactions,Total_NSFs,Ending_Statement_Balance,Pa yroll_Garnishment,Months_A
t_Bank,NSF2,NSF6,Check_Number_Used,PasswordReset,E xistingCustomer,Docs_Recei
ved,Direct_Deposit,Selected,Add_Date,Add_User_UID, Updated_Date,Updated_User_
UID,Hold 66015,,Trevor,,Albrecht,-- Non,123-23-1234,Albr1234,su*****@trevnet.net,1231231234,1234 My
Street,,ORange,CA,92869,ca12323745,CA,Checking,555-555-5555,,,adefdf,adfd,ad
sfdf,CA,34879,Cashtrax,vp operta,123,Friend 1,555-555-5555,sadfdf,Friend 2,444-444-4444,adfd,Friend 3,333-333-3333,adfdf,KEYPOINT CREDIT UNION,505 N MATHILDA AVE,SUNNYVALE,CA,94086,321180515,,,123456789,False ,R,,1ST AND 15TH,,,Google,4/11/2006,4/14/2006,5/1/2006,5/15/2006,4/10/2006 11:52:52 AM,4/10/2006 11:39:25
AM,1234,,123,True,,,,False,123,,,1234,False,False, False,False,False,4/6/2006 12:42:45 PM,,4/10/2006 11:36:42 AM,66015,False
Thanks again, everyone!!!
It'll be because it's being encoded as Unicode.
Add this to the top of your code:-
Response.Codepage = "Windows-1252"
Anthony.
Wow, thanks! It worked like magic! Add one to my box of tricks.
"timstu" <ti****@gmail.com> wrote in message
news:11**********************@z34g2000cwc.googlegr oups.com... Wow, thanks! It worked like magic! Add one to my box of tricks.
Response.codepage is new in IIS6 don't use it in something that needs also
to work in IIS5
I need to display information a list of Active users on a web site.
I can do the count using the global.asa but need to display individual
information about each "active user" without writing it all to a
database and then pulling it out again.
Info I need :
IP Address - Request.ServerVariables("REMOTE_HOST")
The page they are on - Request.ServerVariables("SCRIPT_NAME")
the page they were on - Request.ServerVariables("HTTP_REFERER")
Can I write this stuff into sessions and call them all out?
Thanks
ven
"Ven" <ve*@ogmanewmedia.com> wrote in message
news:KO******************************@bt.com... I need to display information a list of Active users on a web site.
I can do the count using the global.asa but need to display individual information about each "active user" without writing it all to a database and then pulling it out again.
Info I need :
IP Address - Request.ServerVariables("REMOTE_HOST") The page they are on - Request.ServerVariables("SCRIPT_NAME") the page they were on - Request.ServerVariables("HTTP_REFERER")
Can I write this stuff into sessions and call them all out?
Thanks
ven
Did you really intend this to be posted a reply to this theard?
Data in a session object is only available in that session so there isn't
any point storing the above items in the session object.
Storing this stuff in the application object would be real performance
bottleneck.
What are you trying to achieve?
Anthony.
Trying to see all live users on the site
ven
Anthony Jones wrote: "Ven" <ve*@ogmanewmedia.com> wrote in message news:KO******************************@bt.com... I need to display information a list of Active users on a web site.
I can do the count using the global.asa but need to display individual information about each "active user" without writing it all to a database and then pulling it out again.
Info I need :
IP Address - Request.ServerVariables("REMOTE_HOST") The page they are on - Request.ServerVariables("SCRIPT_NAME") the page they were on - Request.ServerVariables("HTTP_REFERER")
Can I write this stuff into sessions and call them all out?
Thanks
ven
Did you really intend this to be posted a reply to this theard?
Data in a session object is only available in that session so there isn't any point storing the above items in the session object.
Storing this stuff in the application object would be real performance bottleneck.
What are you trying to achieve?
Anthony.
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: NanQuan |
last post by:
I'm hoping someone can help me solve this error since I am at a total
loss here. Usually I don't bother posting on any forums or groups on
the internet and prefer to solve stuff myself but this is...
|
by: kermit |
last post by:
I keep seeing that you can use the FileSystemObject in either VB script, or
Javascript on an aspx page.
I added a refrence to the scrrun.dll
I added importing namespaces for 'System.Object',...
|
by: Nick Goloborodko |
last post by:
Hi,
I've been having a really weird problem with required field validator.
Here's the detailed description of the problem:
I have originally been developing my web application on Windows XP...
|
by: Patrick |
last post by:
I have an ASP.NET page that searches for someone in the corporate Active
Directory.
It had been working fine until recently when I changed from Basic
Authentication on IIS6 back to Integrated...
|
by: Charles Law |
last post by:
For some reason, when I click the X to close my MDI parent form, the action
appears to be re-directed to one of the MDI child forms, and the parent
remains open. I am then unable to close the...
|
by: PaulieS |
last post by:
Hi all.
Am migrating a customer from IIS5 on W2K server to IIS6 on W2K3.
Zipped all the websites and unzipped them to the identical locations
on new server. Used IISMT to migrate metabase.
...
|
by: c676228 |
last post by:
Hi everyone,
Our company has several different servers which were hosted in different
places.
One of the servers I administer is using windows 2000 server which can run
both
asp and asp.net. I...
|
by: =?Utf-8?B?c3RldmV3YQ==?= |
last post by:
Microsoft VBScript runtime error '800a0046'
Permission denied
=======================
Trying to find the solution is driving me crazy.
Using IIS6 on Server2003 SBS
Default website localhost...
|
by: Ryan Ritten |
last post by:
Hey all,
I am with godaddy for webhosting right now. The have me using IIS7.
When I run my ASP page I get the error :
Error 500 :There is a problem with the resource you are looking for,
and...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
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,...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
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,...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
| |