Advertisement

01.04.2005 at 10:01AM PST, ID: 21261437
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

5.8

Append raw data to file(logfile)

Asked by Peepsalot in Active Server Pages (ASP)

Tags:

I have an asp page that I would like to create a log of certain data.  I tried using the FileSystemObject, but came to a problem because some of the data I am saving has extended Ascii characters(code 180 i believe), which FSO didn't like.  I kept getting "Invalid procedure call or argument" when trying to write specfic lines.  It would write the lines just fine up until that point.

I need to be able to write any character I please to a file, and have it written exactly as I specify.

Next I tried ADODB.stream to solve my problem.  After hours of trying to decipher vague error messages, I actually got it to almost work once.  It wrote some data to a file, but prefixed my data with a couple bogus characters that were not part of my data.  In addition to that, I cannot figure out a way to append data to a file as opposed to replacing the file with entirely new data.

After getting it almost working once, ADODB.Stream refuses to cooperate once again.  I receive this error when
ADODB.Stream error '800a0bbc'
Write to file failed.

Here is some code that I was working with:

Const adTypeBinary = 1
Const adTypeText = 2
Const adSaveCreateNew = 1
Const adSaveCreateOverWrite = 2

'Create Stream object
Dim BinaryStream2
Set BinaryStream2 = CreateObject("ADODB.Stream")
 
'Open the stream And write binary data To the object
BinaryStream2.Type = adTypeText
BinaryStream2.Open
Response.Write ReadBinaryFile(Server.MapPath("Mailer.log"))
BinaryStream2.WriteText "DATE:" & Now & vbCrLf & vbCrLf
BinaryStream2.WriteText "XML.RESPONSETEXT:" & vbCrLf & xml.responseText & vbCrLf
BinaryStream2.WriteText "FORM DATA SUBMITTED:" & vbCrLf
dim data_piece
for each data_piece in Request.Form
  if instr(ucase(data_piece),"CC")=0 and instr(ucase(data_piece),"CREDIT")=0 then'don't log credit card data
    BinaryStream2.WriteText data_piece & ": " & Request(data_piece) & vbCrLf
  end if
next
BinaryStream2.WriteText "EMAIL BODY:" & vbCrLf & email_string
        
'Save binary data To disk
BinaryStream2.SaveToFile Server.MapPath("Mailer.log"), adSaveCreateNew ' this is the line causing the current error

What I assumed would be an incredibly simple thing to do is turning into a nightmare.  Why won't asp just treat my data like data and write it to the file when I tell it to.  I'd rather be coding in C, a language that doesn't defy all logic.Start Free Trial
 
Loading Advertisement...
 
[+][-]01.04.2005 at 11:44AM PST, ID: 12955600

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 14-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]01.04.2005 at 11:45AM PST, ID: 12955604

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 14-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]01.04.2005 at 12:02PM PST, ID: 12955762

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 14-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]01.04.2005 at 01:01PM PST, ID: 12956352

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 14-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]01.04.2005 at 01:02PM PST, ID: 12956363

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 14-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]01.04.2005 at 01:04PM PST, ID: 12956391

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 14-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]01.04.2005 at 01:25PM PST, ID: 12956567

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 14-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]01.04.2005 at 02:03PM PST, ID: 12956885

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 14-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]01.04.2005 at 04:10PM PST, ID: 12957975

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 14-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]01.04.2005 at 04:14PM PST, ID: 12957998

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 14-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]01.05.2005 at 01:31AM PST, ID: 12960480

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 14-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]01.05.2005 at 08:19AM PST, ID: 12963389

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 14-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]01.05.2005 at 08:41AM PST, ID: 12963649

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 14-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]03.04.2005 at 10:02AM PST, ID: 13461000

Experts Exchange has a courteous staff of administrators who help members get the most out of the website by means of administrative comments like this one.

Start your 14-day free trial to view this Administrative Comment or ask the Experts your question.

 
[+][-]04.23.2005 at 11:57AM PDT, ID: 13851222

Experts Exchange has a courteous staff of administrators who help members get the most out of the website by means of administrative comments like this one.

Start your 14-day free trial to view this Administrative Comment or ask the Experts your question.

 
[+][-]04.28.2005 at 05:37PM PDT, ID: 13891242

View this solution now by starting your 14-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: Active Server Pages (ASP)
Tags: append
Sign Up Now!
Solution Provided By: PAQ_Man
Participating Experts: 4
Solution Grade: A
 
 
 
Loading Advertisement...
20081112-EE-VQP-43