|
This is a database-issue, not an ASP-one. NULL-values in a database (even in text-fields) are not the same as empty strings!
In MS Access, I think there is an option of allowing a text-field to contain empty values (e.g. ""). But its always a good idea to check for NULL.
In VBScript: if IsNull(q1) then, in JScript as you did, I think (never used JScript in ASP myself).
|
|
|
|
|
I have an html-'template' with a form in it.
When it is submitted, the entries will add to an ADODB.COMMAND to update a record in a database.
I am having difficulties with empty form-entries: ADODB.COMMAND.Execute() is complaining about 'cannot use 0-length strings'. A simple workaround like if (s == "") s= " "; does the trick, but that's ugly: I don't want random spaces to appear in my database!
Anyone?
|
|
|
|
|
I'm not positive what your trying to do here but it seems that if you have a chance of a data being an empty string. And this is valid for your application then you should allow zero length fields in your database.
Good Luck!!
|
|
|
|
|
|
hi,
I need to authenticate users to a web site but the problem is I dont want to use session variables, because the site is to be hosted on a web farm running multiple servers and pages can be served from any server. I am trying to figure out how we can authenticate users and how users can be identified after login, in this setup.
any ideas will be appreciated
thanks for your time
karthik
|
|
|
|
|
Hi Karthik,
I have recently read this article at ASPtoday. It should be the solution you are looking for
http://www.asptoday.com/articles/20000704.htm
Regards, Tom.
|
|
|
|
|
If I have a database that has a whole lot of files in it that are incoded in BASE64. Is there some way I can return them straight to HTML so the browser knows to it is downloading a file....e.g.
I want to return the BLOB so that I am really returning an HTML page to the person will see www.xyz.com/download.asp and download.asp contains something like
Content-Type: application/octet-stream;
name="test.exe"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
filename="test.exe"
qANQR1DBwA4DXCexCm8KkTsQAv9wDCPX+7o05gnUq0hH5nEPofQ5a8bpnx82OqvmgKCd65fBIbz9
8GjkmslBrB9N+LU7G0RMbhIZFYHcoqOMW1Jje64UR/6TLQ/61Fw+v/j0bsPXU8/ACdb0tX9kNjR8
C/0C/0k7nBcylnZmMHrYXeuGfjAnLjyXMu08+wCCCf0IYn6COEZObwCXlESgOXfIITMq44QJno91
w4enDZ5t0X9KewUrcVh8hUq4WKsXGPRI0DV5YlJEuNAImlf+DvL4DrtI9cHCTgPZ0XOtEPSlchAM
AKIJh+R2vswfQheAla7fkLp1hqShCra1DkXTdU41EHfwf9EVmOs2d9ovLuFWnH8ukqh8BYNjXuxK
Rfo13mMXqRQBW5b0pKcVPONOcokD2mDaKiuYIbmwm6A+I9LUfAoxg9tj6IrF1LxL53Ysq3FMxqh0
OJKg5iYpBqnhCVgUon6p/Fn41onF9HVhbxZsdRTpIum9YjctoMGNb3DTclp9tX/cEFIGvhuOTZUR
6401S=
and then the browser will know to pop-up a download dialog.
|
|
|
|
|
Personally, I haven't come across such an issue as yours, but I found the following ASP/Vbscript sample code in MSDN..
Response.ContentType = “image/gif”
Set cnnPubs = Server.CreateObject(“ADODB.Connection”)
cnnPubs.Open “pubs”, “sa”
Set rstPub_Info = cnnPubs.Execute(“SELECT logo FROM pub_info WHERE _ pub_id=’1389'”)
Response.BinaryWrite rstPub_Info(“logo”)
Response.End
The idea is to stream out the blob contents to the browser. The example above is probably just a trivial one. Please follow up to
“Delivering Web Images from SQL Server,” by Scott Stanfield (MIND, July 1998) for more info.
MIND is at www.microsoft.com/mind.
Check out "Top Ten Tips Accessing SQL Through ADO and ASP" By J.D. Meier in MSDN.
Hope that helps..
regards
Arup
|
|
|
|
|
I'm sorry about those emoticons.. they were not intentional.
|
|
|
|
|
I am using the MSXML DOM to transform my XML document into HTML using an XSL style sheet.
The XML has tags like this:
<mytag txt=" indented text" />
in the XSL, I reference the txt attribute and output it like this:
<xsl:value-of select="@txt" />
This works fine except the spaces at the front of the string are stripped. I want my spaces back.
I've tried various combinations of xml:space="preserve", <xsl:preserve-space contents="*" /> and anything else in the sparse documentation that looked promising. No luck yet.
Thanks for any help in advance.
(note: it's funny/ironic that the script that processes _this_ question was parsing out my < and > characters, AND it is reducing the three spaces in front of my "indented text" line above to one space.)
|
|
|
|
|
I faced the exact problem and I'm still seeking for an answer. I haven't used IE 5.5's MSXML DOM object yet on this.. I don't know if that fixes the problem. What I have done is to use the following temporary solution.. I embedded some characters in the XSL to represent the spaces and newlines ( eg.. i used "|" for a newline, a "_" for space and "~" for a tab ). Then I processed the XML using the XSL, and replaced all the characters with their actual counterparts ( i.e. replaced the "|: with a newline, the "_" with a space and so on ).
I know that the solution is crude, but it works ( albeit temporarily ).
Please let me know if you come across a more elegant answer.
Hope that helps
regards
Arup
|
|
|
|
|
I have used ActiveX Control in my Web Page. Suppose a client machine does not have this control registerred in the machine. So what script - .inf file or cabinet file i should write in order that the control is downloaded & registerred in the client machine. The dowload should also depend on the type of the browser IE4/5 or netscape. So depending on this IE4.0 a simple control is downloaded & if the it is IE5 then an improved or enhanced version of the control is loaded & registerred. In case of Netscape what to be done.
Pl. let me know.
|
|
|
|
|
Here is a piece of code I use for that:
<br />
<object classid="clsid:fbbaa605-56d2-11d2-a7f8-00a0cc2001a3" codeBase="client.cab#version=0,4,0,25" id="mase" width="1" height="1"><br />
</object><br />
The version-part is the version-resource of an active-x, contained in the cab file.
This only works with IE (no IE-version-checking here). I think Netscape does not/just partly (through 3rd party plugins) support ActiveX.
So you should use ActiveX only when you know the target platform (e.g. Intranet).
|
|
|
|
|
Hi,
There is an article in MSDN "Internet First Steps: Upgrading an Existing ActiveX Control", which explains how to package controls for the downloading.
Regards,
Alex Gorev,
Dundas Software.
|
|
|
|
|
I am a beginning level programmer.
I am doing expanding tree and collaspe tree in Netscape but it doesn't work well.
Here is my code
[pre>
[blockquote>
[div id="root" class=root>
[a href="#" onClick="expand(node1)">Root
[/div>
[div id="node1" class=node>
[a href="#" onClick="expand()">Node1
[div id="subnode1" class=node>
[a href="#" onClick="expand(leaf1)">SubNode1
[div id="leaf1" class=leaf>
leaf1
leaf2
leaf3
[/div>
[a href="#" onClick="expand(leaf2)">SubNode2
[div id="leaf2" class=leaf>
something1
something2
something3
[/div>
[/div>
[a href="#" onClick="expand()">Node2
....
[a href="#" onClick="expand()">Node3
....
[a href="#" onClick="expand()">Node4
...
[/div>
[/blockquote>
[/pre>
The problem is I can't expand the second level.
I just can do only expand for the first level
that is expand(node1) is perfectly done
But if I use to separate each block (each level)=> use it the same as ... It will cause some messy pages in IE.
Need help from generous people or professional or expert.
|
|
|
|
|
|
I am sure that everyone knows how to make a browser window scroll down to the specific place on the page:
all you need to do is add #MyTag at the end of your link. That works great when user clicks on the link. However, if you try to do the same thing with Response.Redirect "mypage.asp?Param1=1#MyTag" it doesn't work. Does anyone know of any way I can Response.Redirect and scroll the page at the same time?
TIA.
Kostya.
|
|
|
|
|
Tried this myself in IE, too. Seems that this does not work.
You could try:
- the Refresh meta-tag in the tag, instead of Response.Redirect or
- do some JavaScript in the OnLoad -event of the target page, to go to the anchor.
|
|
|
|
|
Thank you Uwe.
I did get it to work with JavaScript. My biggest problem was that I had no control over the body tag - I am trying to write an ASP script that would attach to any page. So I it took me a while to figure this one out.
What I had to do is define a script as <script for=window event=onload language=JavaScript>. That worked for IE. For Netscrape I had to define an empty layer with OnLoad event handling like <layer OnLoad="ScrollPage()"></layer>.
Thank you.
|
|
|
|
|
Let me guess - Nutscape will only allow 6 layers in one document, right?
I officially no longer support Nutscape, it is so *&^%$! crap.
I have spent days mucking around doing something so simple in concept and trying to get it to work in IE and Nutscape, and 99% of the problems have been with NS. This is the last straw, it is not capable of displaying anything but ridiculously simple DHTML. No wonder IE is more popular.
Comments?
|
|
|
|
|
I do not like Netscape myself, but I think that there is no 6 layers limitation there. Check this page out for example (it has about 20 layers): Sycamore Software.
Kostya.
|
|
|
|
|
I also dislike netscrap. But I also agree that there is not a 6 layer limit. For example this site http://legendweb.nmt.com has over 30 layers. Many third party .js libraries have requirements for how layers are initialized. You want to look out for this.
Good Luck!!
|
|
|
|
|
Thanks for the nice name NutScape, that is what such products are.
Aaah I hate netscape, oops Nutscape, Nutscape really sick
|
|
|
|
|
I think we've touched on this before but never really found a suitable solution. Is there a simple way to strip HTML from text, on the server, using ASP?
Ideally I'd like a function "StripHTML" which would take a string containing things like "<a href=http://blah.com'><b>My Site</b></a>" and would return "My Site".
I know I can use an ActiveX control (in fact Uwe has written a fantastic text replacement control we'll be using) but a quick simple solution would be wonderful.
|
|
|
|
|
Chris,
Here's a way you can do it in ASP below. I was trying to get just the MSHTML object loaded server side, but have been unsuccessful. There is the overhead of the whole IE instance with this method, but it works. Maybe you could load one for the ASP application and do a server lock and unlock before and after it's use then you only have 1 loaded for the whole application lifetime.
The Solution:
// IN ASP FILE
<%@language="vbscript"%>
<%
On Error Resume Next
Set DOMObject = CreateObject("InternetExplorer.Application")
'Initialize the document object
DOMObject.navigate "about:blank"
'set the inner HTML
' *** REPLACE WITH YOUR setting on RHS. be it from the
' Request object or a session variable.
DOMObject.document.body.innerHTML = "FooBar"
%>
<%=DOMObject.document.body.outerText%>
<%
' Free the IE instance
DOMObject = Nothing
%>
-Erik Thompson
|
|
|
|