Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_databases thread: Returning a word doc delivers login screen?!?


Message #1 by "Patrick Keukens" <keukens@d...> on Sun, 19 Jan 2003 16:52:35
Hi there,

I have two pages one that retrieves a word template from the database and 
sends it back to the browser and one file that opens the returned word 
document and does a mailmerge on that document.
File 1: Returning word document
<%
    Response.buffer = TRUE
    Response.ContentType = "application/msword"
%>
<!--#include file="/dbOpenConn.asp"-->
<!--#include file="/dbSelectTemplate.asp"-->
<%     Response.BinaryWrite(oRs.Fields("File")) 
    Response.End 
%>
<!--#include file="/dbCloseRecordSet.asp"-->
<!--#include file="/dbClose.asp"-->

File 2: opens the returned document in word and does a mailmerge

Set oWordDoc = oWord.Documents.Add
("http://www.mysite.com/get_sjabloon.asp", false)

If I open the file get_sjabloon.asp by hand by typing in the URL after 
login it is oke. If I call it from the menu in the ASP aplication, it 
returns the login screen. It looks like it sets up another session to 
open the word document.

Anyone any suggestions how I can solve this problem?!?!

Thanx in advance!!!
Message #2 by "Neil Jones" <neil@c...> on Tue, 21 Jan 2003 10:19:31 -0500
Has this been resolved?

-----Original Message-----
From: Patrick Keukens [mailto:keukens@d...]
Sent: Sunday, January 19, 2003 4:53 PM
To: ASP Databases
Subject: [asp_databases] Returning a word doc delivers login screen?!?


Hi there,

I have two pages one that retrieves a word template from the database and
sends it back to the browser and one file that opens the returned word
document and does a mailmerge on that document.
File 1: Returning word document
<%
    Response.buffer = TRUE
    Response.ContentType = "application/msword"
%>
<!--#include file="/dbOpenConn.asp"-->
<!--#include file="/dbSelectTemplate.asp"-->
<%     Response.BinaryWrite(oRs.Fields("File"))
    Response.End
%>
<!--#include file="/dbCloseRecordSet.asp"-->
<!--#include file="/dbClose.asp"-->

File 2: opens the returned document in word and does a mailmerge

Set oWordDoc = oWord.Documents.Add
("http://www.mysite.com/get_sjabloon.asp", false)

If I open the file get_sjabloon.asp by hand by typing in the URL after
login it is oke. If I call it from the menu in the ASP aplication, it
returns the login screen. It looks like it sets up another session to
open the word document.

Anyone any suggestions how I can solve this problem?!?!

Thanx in advance!!!


  Return to Index