do your search here :) :-

Google
 

Monday, December 24, 2007

AddCriteria Simplifies SQL Queries

Introduction

Occasionally one discovers a subroutine that greatly simplifies a complex ASP page, transforming spaghetti-like code into something that is easy to maintain. In this article I share one such function used when I need to produce an SQL query from a number of optional criteria posted by the user.
Building an SQL string from optionally posted criteria is tricky. You need to check if the user posted a value since only then is the criteria included in the query. Numeric entries are different from character entries and multiple-selection fields require additional processing to produce a valid SQL query. Fields that might contain single quotes need special attention to prevent syntax errors.
The AddCriteria function (listed later) elegantly encapsulates the logic to build an SQL statement by adding optional criteria only if the user posted data for a field. Here is an example of how one would use it:


The Code
SQL="select * from DataTable"
SQL=AddCriteria(SQL,"Status","=","Status","Chr")
SQL=AddCriteria(SQL,"PCode","=","Code","Num")
SQL=AddCriteria(SQL,"Price",">","LowPrice","Num")
SQL=AddCriteria(SQL,"Price","<","HighPrice","Num")
SQL=AddCriteria(SQL,"Category","in","Catg","Num")
SQL=AddCriteria(SQL,"City","in","City","Chr")
SQL=AddCriteria(SQL,"Name","like","Name","Chr")
The
SQL query is started by specifying everything up to the Where clause. Then the
AddCriteria function is used to assemble optionally posted values and append it
to the SQL expression. The AddCriteria parameters are almost self-explanatory:
Parameter 1: The SQL expression as constructed thus far.Parameter 2: The
database field name for this criterion. Parameter 3: The SQL comparison operator
for this criterion.Parameter 4: The form field name of the posted value.
Parameter 5: The database field's data type: numeric (Num) or character (Chr).
If one posted the following data to a page containing the code snippet
above, the following SQL statement would be generated: Posted
Data:Status=A&HighPrice=5&Catg=101&Catg=203&Name=Edward
SQL
Produced:select * from DataTable
where
Status = 'A' and Price < 5 and
Category in (101,203) and Name like '%Edward%'
Here is the source code for
the AddCriteria function:
Function
AddCriteria(SQL,DBField,Comparison,FormFld,DataType)
Dim
Value,Val,ValArray,ClauseStyle,Connector

AddCriteria=SQL
Value=Request.QueryString(FormFld)
if len(Value)=0 then Exit Function
Comparison=trim(Comparison)
DataType=trim(DataType)
ClauseStyle=ucase(Comparison
& ":" & DataType)

select case ClauseStyle
case "=:CHR"
Value="'" & Replace(Value,"'","''") & "'"

case "=:NUM",
">:NUM", "<:NUM"
if (not isNumeric(Value)) then Value=0

case
"IN:CHR"
Value=Replace(Value,",
",",")
Value=Replace(Value,"'","''")
Value="('" &
Replace(Value,",","','") & "')"

case
"IN:NUM"
ValArray=split(Value,",")
Value=""
for each Val in
ValArray
if isNumeric(Val) then Value=Value & "," &
trim(Val)
next
if len(Value)< 2 then Exit Function
Value=Mid(Value,2) '** remove leading comma
Value="(" & Value &
")"

case "LIKE:CHR"
Value="'%" & Replace(Value,"'","''") &
"%'"

case else
Err.Raise 1,"Function AddCriteria",_
("Missing case
for '" & ClauseStyle & "'")
end select

Connector=" where " '**
for first criterion only
if 0

certification exam

Are you interested in passing a popular IT certification exam? Do you want to increase your salary? Get a Promotion or New Senior Position? Get Hired for a new job? Gain a better understanding of new and emerging technologies that are shaping our world and our future? Capture a foothold in the most explosive industry known as IT or Information Technology? Then it is absolutely critical that you learn the knowledge and skills needed to advance in this IT industry NOW, with proper certification training solutions.
Pass-Guaranteed.com offers leading edge certification training solutions for all IT Certifications like Microsoft®'s MCSE®, MCSA®, MCDBA®, Cisco®'s CCNA®, CCDA®, CCNP®, CCDP®, CCIP®, CCSP®, CCIE® WRITTEN/LAB, SUN® JAVA®, SOLARIS®, ORACLE®8i or 9i DBA®, CompTIA®, A+®, i-NET+®, CISSP®, NETWORK+®, HP®, NOVELL®, CHECK POINT® etc.

4 example ::

if u wanna : Exam 70-210 Practice Test with Full Explanations Includes:
Comprehensive Practice Test Questions with Full Explanations
Detailed Explanations of all the questions
Practice Test Questions accompanied by exhibits
Verified Answers Researched by Industry Experts
Drag and Drop questions as experienced in the Actual Exams
Practice Test Questions with Explanations updated on regular basis
Our Practice Test Questions with Explanations are backed by our 100% MONEY BACK GUARANTEE.
Like actual certification exams, our Practice Tests with Explanations are in multiple-choice (MCQs)

just tell me :)

assemble

Assembler


8086 Assembler Implemented in C++ v0.1
This program is an assembler capable of executing most of the 8086 assembly programs. You can also check out the list file .lst, very similar to TASM list file. The intention of uploading this project is to let you have a general idea of how an assembler works.




A86 macro assembler, V3.72




African Assembler (ASM++) v7.3
The African assembler by Tinashe Mutandagayi,19 Zimbabwe Which now supports omf16 and 32 objects and can also produce mz exes and .coms

BBC BASIC for Windows 4.00
BBC BASIC for Windows is an implementation of the BBC BASIC programming language for PCs running Microsoft Windows. It combines the simplicity of BASIC with the sophistication of a modern structured language, allowing you to write utilities and games, use sound and graphics, perform calculations an...

CodeX Assembler v1.0
CodeX Assembler is a Freeware x86 assembler supporting all x86 instruction sets up to SSE2 (AMD 3D Now! also included) with an integrated linker that creates 16 and 32 bit flat model binaries, 16 bit DOS COM and EXE files as well as 32 bit DOS applications. The assembler provides numerous specia..

flat assembler 1.64 for Windows
This is a Windows version of flat assembler - apart from the command line version for Windows console this package contains the one with integrated syntax-highlighting editor, so you can edit, compile and execute your programs from one place. It also contains the set of includes with equates

Saturday, December 22, 2007

CODE (programming language)

CODE is a visual programming language and system for parallel programming, letting users compose sequential programs into parallel ones. The parallel program is a directed graph, where data flows on arcs linking the nodes representing the sequential programs. The sequential programs may be written in any language, and CODE outputs parallel programs for a variety of architectures, as its model is architecture independent

Source code

In computer science, source code (commonly just source or code) is any sequence of statements and/or declarations written in some human-readable computer programming language.

The source code which constitutes a program is usually held in one or more text files, sometimes stored in databases as stored procedures and may also appear as code snippets printed in books or other media. A large collection of source code files may be organized into a directory tree, in which case it may also be known as a source tree.

A computer program's source code is the collection of files needed to convert from human-readable form to some kind of computer-executable form. The source code may be converted into an executable file by a compiler, or executed on the fly from the human readable form with the aid of an interpreter.

The code base of a programming project is the larger collection of all the source code of all the computer programs which make up the project.

The source code for a particular piece of software may be contained in a single file or many files. A program's source code is not necessarily all written in the same programming language; for example, it is common for a program to be written primarily in the C programming language, with some portions written in Assembly language for optimization purposes. It is also possible for some components of a piece of software to be written and compiled separately, in an arbitrary programming language, and later integrated into the software using a technique called library linking. In some languages, such as Java, this is essentially how each file is handled; each is compiled separately and linked at runtime. Yet another method is to make the main program an interpreter for a programming language, either designed specifically for the application in question or general-purpose, and then write the bulk of the actual user functionality as macros or other forms of add-ins in this language, an approach taken for example by the GNU Emacs text editor.

Moderately complex software customarily requires the compilation or assembly of several, sometimes dozens or even hundreds, of different source code files. This complexity is reduced considerably by the inclusion of a Makefile with the source code, which describes the relationships among the source code files, and contains information about how they are to be compiled. The revision control system is another tool frequently used by developers for source code maintenance.

Friday, December 21, 2007

ANTIVIRUS & smart .....

share ur opininon about ur antivirus also let us develop it :)

good idea good feel :)

Thursday, December 20, 2007

new codes

add new codes is allowed plz if u have ... :)

thanks

Friday, December 14, 2007

Forget Controls MultiMedia. Now By API Support DVD Video Version 6.1


Forget Controls MultiMedia. Now By API Support DVD Video Version 6.1


(New version, now version 6.1 with control volume channels audio) Hello, You can here make Controls for audio,video and midi files just by pure Windows API. you can open,play,pause,resume,stop,close,make control for audio channels,Get Progress,Get Total Time,Get Total frames,Get Number frames per second,SetAutoRepeat,GetCurrent frame (Get current position),Get cuurent time,Get Actual size,Get Current Size,resize the movie,SetDefaultDevice,let you at the end of file..for all types Multimedia qt,mov, dat,snd, mpg, mpa, mpv, enc, m1v, mp2,mp3, mpe, mpeg, mpm au,snd, aif, aiff, aifc,wav,avi,mid,rmi,(and *.vob this format for dvd video)...etc.
Are you Sure wanna using Windows API to Playing video *.dat) or audio (including (including *.mpg and *.mp3) or Midi files and forget ocx?Then Download this source.
I know the Controls like MCI32.ocx, ActiveMovie and Media player can do this but the control have disadvantages like it size about more than 90 kb,but now your program just will increased 6 kilo bytes(this size of the Module) and not take system resources.
Advantages for this Source Code
1-This code Just use Windows API calls (no ocx) ,no install new dll.
2-This code work useful for Windows98,Windows 2000 and Windows NT without installing any other programs.
3-It has ready functions in the Module or Dll for Standerd use just for copy and paste in your own projects.
4-More faster than WinAmp and Xing Mpeg in playing and viewing Movie.
5-It can playing all Multimedia files by less lines included mp3,mpg,avi,wav..etc.
6-It has the most controls for multimedia files(keep on reading the page and you will know the controls).
7-It can open all movie files.
8-It have descriptions.
9-It Include four Sources in the zip (three for vb and dll in C++).
10-It for all Levels (advanced - intermediate - beginner).
11-very easy (read the code carefully).
12-Others (keep on reading this page).
This code Updated to be more well Download it again
Please reRead the descriptions for function OpenMultimedia in the form or in the Module.
Version 6.1
Special thanks to "Hans de Vries" For Notice me about bug when playing rmi files in some computers (it was repaired).
Version 6.0
For request Members planet-source-code I add four Functions:
1-Two Functions to deal with volume audio for every channel(left or right) or the the both:
one to get volume for every channel audio and the another to set volume for every channel or the both.
NOTE: Contolling with volume for every Multimedia file not for all Multimedia files(not like Mixer windows).
2-Two Functions to deal with Rate playing Multimedia file (one to increase speed playing or decrease speed playing and the another to get current Rate).
NOTE: Contolling with Rate for every Multimedia file not for all Multimedia files.
Via this version you can watch a movie file and also playing mp3 file at the same time and decrease the volume for mp3 in one channel or the both.
See the screenshot.
Good luke.
Version 5.0
1-In this version there were common errors in Windows 2000 was repaired (now the code useful for win2000).
2-I added Function for Channels Audio Control (see the screenshot).
What the Advantages for this Update?
you can here play on Left channel audio file and on right channel another audio file at the same time Or:
play the file two times at the same time one on the left and the another on the right.
Click on buttons "Demo" to see some effect by this way.
Note: you must Extract all files from the zip.
Good luke.
(Update IIII)
there were some common errors in Windows NT4 was repaired (Special thanks to Alex for notice me)
and I added function for request memebers to get the actual size and current size.
Note the update just in source "MultiMedia Contoller"
(Update III)
I added the source code which sent to MSDN library and it Update for previous version from "Pure API".
What the Advantages for this Update?
It can open more than one Multimedia file at the same time and play it .
e.g.
(you can play more than one mp3 or movie at the same time).
Important note: You can play a lot files at same time if it from type "MPEGVideo" this mean just the following types you can play it altogther :
qt,mov, dat,snd, mpg, mpa, mpv, enc, m1v, mp2,mp3, mpe, mpeg, mpm au,snd, aif, aiff, aifc,wav,,etc.
and the following types can not play altogether :
mid,rmi,avi. becsause the sound card will be busy.
anyway most peoples using mpg,dat,mov,etc for the movie and mp3,mp2,mp1,wav,etc for the audio and if you have movie (avi) you can convert it to mpg ,dat ,mov or any other mpegs types and play it altogther.
if you wanna the ways to convert avi to mpegs types please contact to me at : a_ahdal@yahoo.com
this will benefit you if you wanna make some simple games,,etc.
see the picture in this page to show the program.
(UPDATE II)
I added two Functions one to Get Frames per Second
and the Another to let you know if the File Multimedia at the End (this benefit you if you wanna play a list of Multimedia Files).
(UPDATE I)
You can by this update to open any file even have spaces.(Special Thanks to Janet)
And I added two Functions to repair any problem will met you if you used Xing Mpeg Drivers.
You can here Play all MultiMeida Files by Pure API
in first if you wanna playing these types:qt , mov, dat,snd, mpg, mpa, mpv, enc, m1v, mp2,mp3, mpe, mpeg, mpmau , snd, aif, aiff, aifc,wav.The Secret is:You Must use when you write Command To MCI by FunctionmciSendString write like this :open c:\myfile type MpegVideo .......etcnote: we written "MpegVideo" as a typeand we will writtenopen c:\myfile type AviVideo .......etcif we wanna opening avi files..

FRIEND SHIP

hello every body i will make friend ship with me 4 any one wanna that to make easy learn programming language

wellcome

wellcome
hello every body
plz mail me at my e.mail or let comment if u want that
:)

code 1

u wanna learn code??
v.basic or c++ or c#
just see us every day i will start make u learn this
that is easy just see what i will do 4 u?
that is all 4 free man :)
yes that is 4 free :)

TAKE A TOUR HERE ::-