Wrox Programmer Forums
|
Classic ASP Databases Discuss using ASP 3 to work with data in databases, including ASP Database Setup issues from the old P2P forum on this specific subtopic. See also the book forum Beginning ASP.NET Databases for questions specific to that book. NOT for ASP.NET 1.0, 1.1, or 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Databases section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 18th, 2003, 11:55 AM
Registered User
 
Join Date: Aug 2003
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to bjtindle
Default Printing address labels from my ASP application

Is it possible to retrieve contact details from a SQL server or Access database on a remote host via an ASP-based application and print them onto labels from a client machine via the Net using the client's installation of SQL server or Access and the ASP based application? Hope this is clear enough!

Any pointers much appreciated, I'm getting desperate!!!
 
Old August 21st, 2003, 03:03 AM
Registered User
 
Join Date: Aug 2003
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to fizzystutter
Default

The quick answer to this is yes.

It may not be very stable as I have this process in a few of my clients offices.

1. Create the word document containing the lables
2. Save it as .rtf
3. Open the rtf in notepad or similar. You can now see the raw code that builds the rtf
The important commands you are looking for are:

\par (new line)
\page (new page)

Now what you need to do is create the rtf using the FSO command so that you create it on the fly whilst embedding your data into it.

Once the file is built you can then send the file to the browser (not very stable, although it does work) or email the document using an appropiate email object (CDO, ASPemail etc)



Finally I have included the fso command that takes the original RTF and builds a new file (new.txt) that contains the FSO command for each line of the file, therefore you don't have to insert the command by hand.


' the rft containing the labels
varfile = "1.rtf"

' the file that you are about to build
newfile = "new.txt"

Set objFS = Server.CreateObject("Scripting.FileSystemObject")
Set objTS = objFS.OpenTextFile(Server.MapPath(varfile), 1)

Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objTextFile = objFSO.CreateTextFile(Server.MapPath(newfile))

' create the new text file
While Not objTS.AtEndOfStream

objTextFile.WriteLine "MyFile.WriteLine """ & Replace(objTS.ReadLine, """", """") & """"

Wend


Set objFSO = Nothing
Set objTextFile = Nothing


Set objTS = Nothing
Set objFS = Nothing



I am trying to find a better way of reporting through a browser that is either cheap / free and stable. I am currently looking at creating access reports on fly via asp. See my topic titled "Pass value into Access Report"

HTH !

 
Old August 21st, 2003, 10:23 PM
Authorized User
 
Join Date: Aug 2003
Posts: 78
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to spraveens
Default

Hello

My query is that How do I execute an sql query with a click of an hyper link, for ex: when I click on the link "view all customers" , I want the query "select * from customerinfo" to be executed and the results displayed.How do I do It?

Thank You

S.Praveen



 
Old December 16th, 2007, 08:00 AM
Authorized User
 
Join Date: Nov 2007
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hello.

Did you find a conclusion for this as I am looking at how to do this?









Similar Threads
Thread Thread Starter Forum Replies Last Post
Urgent: Print address labels aspBegineer83 ASP.NET 2.0 Basics 1 January 11th, 2008 08:59 AM
address labels to columnar form skrj02 Excel VBA 0 January 2nd, 2007 02:48 PM
labels from a name/address mySQL db p2p-mlh PHP Databases 1 June 8th, 2004 06:14 PM
name/address labels from mySQL db p2p-mlh PHP How-To 1 June 8th, 2004 06:14 PM
Printing address labels ASP/Access bjtindle Access ASP 1 September 23rd, 2003 11:57 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.