|
Greetings Programs,
Now I realize most people have problem persisting thier database connections, I on the other hand have a problem with persistant connections.
Heres the skinny: Take a simple portion of my code such as:
Dim CN
Dim RS
Set CN = Server.CreateObject("ADODB.Connection")
Set RS = Server.CreateObject("ADODB.Recordset")
CN.Open = "Provider=SQLOLEDB; Data Source=BLAH; UID=BLAH; PWD=BLAH;"
Set RS = CN.Execute("SELECT * FROM ##tmpTable")
Response.Write BLAH
RS.Close
CN.Close
The problem is that even though the recordset and connection are close, the database still shows a connection. Does anyone know why this connection persists? How can I make sure this sucker dies on command?
Thanks,
Rhoam
|
|
|
|
|
This little page with information might help you out..
http://www.lockwoodtech.com/index.asp?PageId=Art_connection_pooling_ASP_I&TitleID=Top_Articles
good luck
|
|
|
|
|
You need to add this
Set RS = Nothing
Set CN = Nothing
After to close the recordset and the connection....
Best Regrards!!!
Carlos Antollini.
|
|
|
|
|
Hi!
I'm trying to do this:
In a form METHOD="post" ENCTYPE="multipart/form-data" ACTION="getnew.asp"
a user inserts his name (for example: 'John') in a text field and browse a file to upload (pic1.gif).Then submits the form.
How can I create a folder name 'John' in the disk through Request.BinaryRead and upload the file pic1.gif and at the same time insert in a database text fields 'John' , 'pic1.gif' due to later search for users and show the file that he had uploaded?
I tried many ways but i cannot put Request.BinaryRead and Request.Form in the same asp page...
Has anyone tried this?
Any ideas or examples?
Thanx in advance.
|
|
|
|
|
|
NT4 SP6/IIS4/Baffled Programmer.
We have a need on our internet for the users to print a file from an ASP page, the file is destined for the default printer of the IIS server (Simple enough?).
Currently we are creating a scripting object:
Set WshShell = Server.CreateObject("WScript.Shell")
That then calls a batch file:
WshShell.Run "c:/temp/lhead.bat"
The batch file executes OK when called standalone, but when executed on the back of IIS failed to write anything to LPT1. (It currently simply contains DIR > LPT1)
Is there some kind of security restriction that I should be looking at?
Is there an easier way of achieving this?
|
|
|
|
|
Further to this I know think I know why, but I'm still looking for a way around it.
I've swopped the WScript.Shell component for ASPExec, if I now exec notepad through ASP then attempt to print, it fails to write to lpt1, (Notepad is running as SYSTEM). If I manually start notepad (as the logged on user) and print it works.
So the problem appears to be with SYSTEM tasks accessing the printers, do anyone know about this?
|
|
|
|
|
Maybe this kind of access must be run in its own process. The IUSR_<machine> account is only allowed to run InProc. To access process that require OutOfProc you must use an account with such previleges. One way is to create a com-component, add it to the MTS and assign it to run under a specified user account, and then add that account to the security settings in DCom Config Manager (which you start from Start --> Run "DCOMCNFG").
Be sure to test this in a labb environment: I had some problems when I tested this for reaching Excel functionallity from IIS.
Knowledgebase article Q198432 at MS' site has more info about this.
Good Luck!
Consultant, system/web developer.
IMS Consulting AB, Sweden
|
|
|
|
|
Thanks for that, I have track the problem down to Q184291 COM Objects fail to print when called from ASP.
The bottom line is the system account that is running IIS does not have any printer ports by default. The article describes copying then from the default user. This fixes the problem is the printer is local but not if its a network printer.
I found a few nice ASP printing objects on the web that get around that one but in my instance the printer is on a remote Netware print server. I gave up at this point, reconfigured my Unix server to print to the Netware box and hey presto!
Regards,
Kevin.
|
|
|
|
|
Ok, I have my html page called test.htm, my external javascript file called images.js and one of my images called banner_02.gif. They are all in the same directory.
I am doing this so I only need to change the addresses of several images from one file that will then be used across several pages.
This is my html code (don't mind the rest, just my variable imSRC = banner;):
function makeIm() {
NS4=(document.layers);
IE4=(document.all);
scaleWidth = true;
scaleHeight = true;
imSRC = banner;
if (NS4) {
origWidth = innerWidth;
origHeight = innerHeight;}
function reDo() {
if (innerWidth != origWidth || innerHeight != origHeight)
location.reload();}
if (NS4) onresize = reDo;
if (IE4) onresize = reDoIE;
function reDoIE(){
imBG.width = document.body.clientWidth;
imBG.height = document.body.clientHeight;}
winWid = (NS4) ? innerWidth : document.body.clientWidth;
winHgt = (NS4) ? innerHeight : document.body.clientHeight;
imStr = "
+ " style='position:absolute;left ;top ;z-index:-1'>"
+ "<img name='imBG' border='0' src="+imSRC;
if (scaleWidth) imStr += " width="+winWid;
if (scaleHeight) imStr += " height="+winHgt;
imStr += ">
";
document.write(imStr);}
makeIm();
------------------------
Now, I aren't sure how I should write images.js
This is all I have:
var banner = "banner_02.gif";
--------------------------
I know that test.htm is reaching images.js, because when I remove script src="images.js" I get an error with the variable banner.
How do I write the external javascript file?
Regards
JRoberts
|
|
|
|
|
How do i use ASP in Flash..like usin ASP in a guestbook created in flash?
Please Help Me!
Sign Of JOLLYROGERS!
|
|
|
|
|
|
Hi,
I'm having problems with
Response.ContentType = "application/vnd.ms-excel"
that it works fine with up to ca 100k files but after that it just "time-out" or something.. i.e nothing after 3 minutes (default timeout on webserver). I've tried to increase timeout value on www server (IIS5) but that didn't help.
Any suggestions or IS there a limit of how big files you can send through ContentType?
/michael
|
|
|
|
|
An application I am working on streams files of several MB out of a database blob and to a browser. They have been only been Word doc files, but I would assume that all file types are handled the same.
Here is a snip of the code I use:
<%
Response.Buffer = TRUE
Response.ContentType = "application/vnd.ms-word"
StrContentDisp = "inline; filename=" & objRs("Document_Filename")
Response.AddHeader "content-disposition", StrContentDisp
Response.BinaryWrite objRs("Document")
%>
I also had odd problems until I started doing the .AddHeader to declare the document to be inline and pass the filename. The snippet above has worked smoothly ever since.
Obviously the recordset and binarywrite may not be needed for your situation, but they can be substituted out easily enough.
I am using IIS5 and MSSQL2k and ASP3, just for reference.
Hope that helps.
Jason Jystad
Cito Technologies
www.citotech.net
Sonork ID 100.9918
>-------------------------------------------------<
Every program has at least one bug and can be shortened by at least one instruction -- from which, by induction, one can deduce that every program can be reduced to one instruction that doesn't work.
>-------------------------------------------------<
|
|
|
|
|
it helped alot, i solved my problem by increasing script timeout value though.. not a good solution but i thank you for this snippet of code.
regards,
/michael
|
|
|
|
|
I have been thinking about the server side controls in ASP.NET and was wondering of anybody is planning to use them as they seem to offer some benefits. They are also in ASP, yet as far as I know, they are not widely used, certainly I have never come across it.
Should I just carry on writing ASP scripts but take advantage of the compiled code in ASP.NET, or should I be looking to change the way I develop web apps?
What are other people planning to do?
Bob.
|
|
|
|
|
|
i want to create a form to send email how can i create it using just html?
that mean i want to create a form then i clik submit the all the data in the form with send by email
|
|
|
|
|
AFAIK, you can't do this using *just* HTML. You have to use some sort of server scripting language and a mailing component. ASP supports this functionality if you're a Windows guy, or if you're on *nix, PHP does this *very* easily (1 function call).
Jon Sagara
"We assume you already know not to consider something like Windows as a firewall platform. Does the name "Windows" evoke images of security? Silly rabbit, Windows is for desktops." -- Unix System Administration Handbook
|
|
|
|
|
Indeed... you're going to need more than just HTML. Try searching at google for formmail. Or.. you could learn PHP.. which is nice.
|
|
|
|
|
If you are using Windows, the component to use is cdonts. You can create a new mail object with the line
set mail = server.createobject("cdonts.newmail")
Consultant, system/web developer.
IMS Consulting AB, Sweden
|
|
|
|
|
Just use the following, it'll use the web clients default mail software:
|
|
|
|
|
I have to format some data into a table. It will be column driven rather than row driven. How hard is this? Can anyone show me an exmple?
Station 1 Station 2 Station 3
WKRP WDC1 WSSX
Talk Rock Top 40
I can implement it either way, but I want my XML file to be logical.
<station>
<stationid>1
<callletters>WKRP
<formt>Talk<format>
Oh, and oh, lawd, can someone send me a link to a site that will list XSL help, like a cheatsheet of what all the tags are/mean?
Thanks!
Lilian
|
|
|
|
|
Lilian,
Best thing that I can recommend is that you pick up a good book on the subject.
My 2 personal favourites are:
o XML for ASP.NET Developers
[ does an excellent job in explaining XSLT and XPath ]
o XSLT 2nd Edition (Worx Press)
[ XSLT? What do you want to know ]
In addition to that, here's a neat link to test out your newly found XPath'ing skills...
http://staff.develop.com/aarons/bits/xpath-builder/xpath.htm
and a couple of expressions to play around with...
GETTING THE COMMENT
//comment()
//comment()[position()=1]
GETTING THE 3 SIBLINGS UNDER THE COMMENT
//comment()[position()=1]/following-sibling::*
OR JUST THE MIDDLE ONE
//comment()[position()=1]/following-sibling::LineItem[position()=2]
//comment()[position()=1]/following::LineItem[position()=2]
HTH
|
|
|
|
|
Download this from MS. Quite handy reference.
http://msdn.microsoft.com/downloads/samples/internet/default.asp?url=/downloads/samples/internet/xml/multiple_views/default.asp
Dan
---
|
|
|
|