I have been playing with an idea that generates ASP files using an asp document and the file system object, so far it is doing great except one thing, when I have a chunk of text and I need to include an asp bracket ("<%" or "%>") regardless of being within the "quotation" marks the active asp document assumes it is a part of its own code and the script errors.
To get around this currently I am writing brackets like this "[<]" or "[>]" and then swapping them out of the generated ASP page using dreamweaver after creation.
The question is: Does anyone know how to represent asp brackets within a string being processed using asp??? Code:
I'm writing a script lately to write some records into a text file for backup purpose. But may i know do asp allow update for the text file? Cause i dun want it to overwrite my previous records.
I'm having some problems writing files to my Access database using ASP. I have a table with a couple of fields, one being of OLE datatype, that holds the file. I'm able to write and read small images, but I'm getting corrupted files when I try Word files, and my code is erroring out when I try to writing pdf files.
I think I've found the problem with the uploading of the pdf file (I think I need to adjust some IIS setting to allow larger file uploads), but I don't know what's going on with the word documents. They are small, so upload fine. Does anyone have any experience writing files to Access?
I have a website that we display images we have saved into a SQL Server 2000 database as binary BLOB. This is on a Windows 2003 Server. Just recently (a week ago) this website began to save the images it is displaying on the website as ASP pages in the Temporary Internet Files > IE.Content > Folder.
We have other websites where we use the exact same code and these do not save files on the server when they are displayed.
Here is the code to display the image: Set rs = objConn.Execute( SQL ) Response.ContentType = "application/octet-stream" Response.BinaryWrite rs("Product_Image")
SQL is the SQL String to get the image from database
When I add this code:
Response.ContentType = "image/jpeg"
The images still display on the website, but now are saved in the Temporary Internet Files folder as JPG's.
Ok, for my company, we have two current webpages, one for general company info and one specific to a product that we market. On the 2nd page, there is a form that allows users to request a consultation from the company. When it is sent, the information is stored in an Access DB for tracking purposes.
Now, I have been requested to put this same form on the general company website. All works fine, but I can't save to the db that is stroing the info once it is submitted. Boith sites are hosted by the smae company, but they do not have (as far as I know), a shared repository for files where I could put the db.
Does anyone have any suggestions as to how I can get around this issue? What I want to do is to have the form on both sites and have the submitted data saved into the one database.
I'm not getting error messages on this one so I don't know where to start looking. I type in my data in my form and this page should check it, add it then set a flag. Code:
I have to perform a database query and write the results to an XML file.
I also need to form this XML file with a DTD file.
I'd like to hear some opinions on the best way to do this.
I figured out how to write out just raw XML using adPersistXML. But that doesn't really help as the XML needs to conform to the DTD.
I also found a way to write out the XML file line by line using .createNode and .appendChild...but that would take forever as the database query returns 72 columns.
I have the following code as a part of authenticating a system. If Rs.eof Then Session("Authenticated") = 0 Response.Write "Sorry, your userid or password did not match" Response.Write "<BR>" Response.Write "or you have not registered yet. Please register" Response.Redirect("login.asp") Else Session("Authenticated") = 1 Response.Redirect ("Welcome.asp") End If In the first if statement, I would like to display the above messages before forcing the login.asp page to display. Is is possible to do both message and contents of login.asp in the same page? Thanks
i am having problems figuring out the syntax used when writing information to a database thru a dropdown. i have a dropdown w/ all the months listed and i need this recorded into a database where i have already set up a column named "month". right now all i have is html that says:
Code:
<select name="month"> <option value="January">January</option> <option value="March">March</option> <option value="April">April</option> ....... and so on....... </select>
I have an asp page that queries a database and displays a report. There is a button on this page that I would like to dump the report into Excel. The code behind the button:
var xl = window.open("/reportexport.asp", "_blank");
and a new window is displayed with excel. Now the problem is how do I get the report html into this new window? xl.document.write(window.document.body.innerHTML); is obviously not the way since it doesn't work.
reportexport.asp contains only two lines: Response.ContentType = "application/vnd.ms-excel" Response.AddHeader "Content-Disposition", "filename=report.xls;"
I've been having problem writing a cookie. Everything goes ok but when I supply the .Path property to "/" It just write the cookie when there is no cookie present, but when I try to update the cookie (or overwrite the cookie) it doesnt change it.My requirement to supply the path to "/" because ASP.NET reads it. If I write the cookie without supplying the path, the ASP.NET pages are unable to read the cookie.
I have written a program where according to my query all the ouput is written to the text file. I want to add 3 lines to my text file which are needed so that it can be exported into outlook. Code:
We have an existing ASP app that is doing a very simple form submission to an Access db. So it opens a connection does a write and closes the connection.
The problem is that every other form submission is failing because of an "Unspecified Error" - according to our IIS web server log.
I have 2 things I'd like help with.
1) Writing to a log file: I'd like to write to a log file (either the web servers or a different one) from the server side code within the ASP app. So, once the code opens the DB connect I would like to know it was a success. Once it writes, I want to see the string its trying to put in, etc...
How would I do this in our ASP/IIS environment?
2) Catch errors:
If I'm opening a db connection to this access db, how can I be sure the connection is a success? does a value get returned that would indicate success/failure? if so how do I capture it? I'm speaking of some type of try-catch system.
is there another approach I should be taking to debug this problem?
im writing an asp code to extract data textfiles from the server using FSO, but when I run the script the file were save at the server drive(c not on my local drive
writing cookies seems to be a no brainer, but for some reason, my temporary internet folder does not contain any of the cookies when run the pages. i am starting to think that it may be IIS 4.0. anyhow, these are the cookies that i writing:
Error Type: Microsoft VBScript compilation (0x800A0401) Expected end of statement /Web2_Local/custquery.asp, line 180, column 21 Open "DOWNLOAD.FIL" For Binary Access Write As #1
filename = server.mappath(session("Directory") & "/Text/" & ExportFileName) Set ScriptObject = Server.CreateObject("Scripting.FileSystemObject") Set MyFile = ScriptObject.OpenTextFile(filename,2,true) Myfile.writeline exportString MyFile.Close
I'm putting tabs in the exportString the C way e.g. " " but they come out in the text file literally. How does one write a tab to a file with asp? (I don't want an HTML tab!)
I am a web developer that deals with reporting.I am trying to make a print application so i can choose a few reports and then print them.I tried to do the window.print() but i don't want the print dialog box to come up.I am going to try and print from the server using WSH.
is that i need to write what is on my page to a file.The pages are dynamically created and have many tables on them.Is there a way to write the page that i am displaying to a file while keeping the formating intact.
I'm writing a company intranet site,and on the home page,I'd like there to be links to some of the software that the employees frequently use on their own computer.This will be the inducement to get them to use the intranet home page as their default home page, and visit it frequently.
I want to write a query which basically invoves 2 tables: Status and Code.I want to insert the content of one of the field of the table code into one of the fields of the table status.Something like this:
INSERT INTO Status ([Instructions] values ("Select doc from Code where Id="&Request.Querystring("ID")&" ")
I wanted to know the query how i could insert data from one table to one of the fields in other table?
Totalperdayleads contains 2 & totalleads contains 11. now inst_register table contains per_day_download,download_Date fields in per_Day_downlaod is initially 0 & it will be go max upto Totalperdayleads i.e.2 for one day then i have to compare date with download_Date from inst_register & again for next day 2 Totalperdayleads this way i have to allocate totalleads in per_day_downlaod field of inst_register.
How can I, or is it possible to create a file with a .htm extention and have includes within that file? I am trying to do so through the following code but nothing is happening when I view the newly created file.
dim fs dim file
set fs = CreateObject("Scripting.FileSystemObject") set file = fs.CreateTextFile(path & newFileName & ".htm", true) file.WriteLine("<!-- #include file='header.htm'-->") file.Close
This creates the new file but when I try to view it, the header information is not included, so how can I accomplish this?
I'm using the folowing code to search through a text file using FSO and only response.write the lines that start with "Flow": Code:
Do While f.AtEndOfStream = False If left(f.Readline,4) = "Flow" Then response.write f.ReadLine End if Loop
after I evaluate a line with the If statement it moves to the next line so I'm always writing the line after the one I want. How do I get away from this?
I have an asp page that is supposed to write text to a text file. I know how to write to a text file using Server.MapPath, but how to I write to a file that is on another server?
I cant seem to right to my asp database... This is my code. Code:
set conn=Server.CreateObject("ADODB.Connection") conn.Provider="Microsoft.Jet.OLEDB.4.0" conn.Open Server.MapPath("/db") & "/db.mdb" ors = Server.CreateObject("ADODB.recordset") sql = "SLECT * FROM members" ors.open sql,conn,adOpenDynamic,adLockOptimistic,adCmdText This is the error message I get...
Object doesn't support this property or method: 'ors.Open'
I have a form that submits an order and it sends it to the visa site and they get the info, but my problem is I get the info back from them with the amount of the order but I don't know what they purchased and the quantity.
What I want to do is on my page is also have it write to a text file on my server, but I am not sure how to do that? I have text fields and radio buttons on my site what I want it to do on submit is also write the info to a text file so I have the customers information as to what they purchased and the quantity.
Is there a way to have it submit to the CC company and write to a text file at the same time using asp code? do I need to write a loop of somekind?