|
|
similar
comment
New Page 1
| ASPDeveloper.Net
Free ASP & Scripting Code |
Database Code Examples
Removing
records over 1 week old in SQL Server
delete from tablename where
datediff(day,accessd,getdate()) > 7 (for two weeks, replace 7
with 14, etc.)
Just launch SQL Enterprise
Manager, connect to your database and select "Server"
-> "Scheduled Tasks" or add this to your current
ASP Code.
|
Remove
single quotes from data input in a form
This code will remove single quotes and
apostrophes which can mess up SQL statements submitted to .mdb
or SQL Server databases. You can put it into a separate file to
include, or put it on each page where you want to use it.
<SCRIPT>
LANGUAGE="VBSCRIPT" RUNAT="Server">
FUNCTION unQuote (s)
pos = Instr(s, "'")
While pos > 0
s = Mid(s,1,pos) & "'" & Mid(s,pos+1)
pos = InStr(pos+2, s, "'")
Wend
unQuote = Trim(s)
END FUNCTION
</SCRIPT>
|
Scripting Code Examples
Refresh
2 frames from 1 click in a form of another frame
The following is a snippet from a JavaScript
that you can use as a banner across your site. It changes the
content and main pages in the frame:
<a href="javascript:frcontents()">
<!--
function frcontents(){
parent.contents.location.href="frother.htm"
parent.main.location.href="/isdsite/brochure/dcc-awe.htm"
}
//-->
|
Created by: admin
last modification: Friday 19 of November, 2004 [12:58:34 UTC] by admin
|
|