f



Validating form data against a SQL Server database or flat file

Hello,

OK, I know, using client-side validation to validate form data like
this isn't the best way in terms of security:

<script language="JavaScript">
function GetContactName(formObj)
{
var sServer = "LOCAL";
var sDatabase = "Northwind";
var sUid = "test";
var sPwd = "password";
var sUserIdToLookup = formObj;

var oConn = new ActiveXObject("ADODB.Connection");
var sConnString = "PROVIDER=MSDASQL"
+ ";DRIVER={SQL Server}"
+ ";SERVER=" + sServer
+ ";DATABASE=" + sDatabase
+ ";UID=" + sUid
+ ";PWD=" + sPwd
+ ";";
oConn.Open(sConnString);

var oRS = oConn.Execute("SELECT ContactName FROM Customers WHERE
CustomerID='" + sUserIdToLookup + "'");

if (!oRS.EOF)
{
alert("The contact name for " + sUserIdToLookup + " is " +
oRS("ContactName").Value);
}
else
{
alert("User not found.");
oConn.Close();
}
}
</script>
<FORM>
<INPUT TYPE="text" NAME="test">
<INPUT TYPE="submit" value="I'm Feeling Lucky" NAME=btn1
onClick="GetContactName(this)">
</FORM>

But........, is there a way to compare the form object value against
values in a flat file, like with arrays? I have an Excel sheet of 1300
values I'd like to be able to use as a comparator against the value I
grab from the form to validate the input.

Thanks for any examples, help or suggestions,
KP

0
2/11/2006 8:16:44 PM
comp.lang.javascript 38370 articles. 2 followers. javascript4 (1315) is leader. Post Follow

0 Replies
691 Views

Similar Articles

[PageSpeed] 26

Reply:

Similar Artilces:

File Server Database Apps and SQL Server?
Like a lot of database developers, I often choose Jet for the back- end. I'm starting to worry about what will happen when Jet is deprecated. Ostensibly, Jet users like me must switch to SQL Server (or MSDE / SQL Express), but there's something I just don't understand. Without Jet, how will we create file server database applications? In other words, how will we create multi-user apps which use a file server to share data and don't require a database server? I've seen many discussions of Access vs. SQL Server, but I've never seen this question addressed head-on. I can ...

MicroSoft SQL Server 2000, Service Pack 2, AppDev SQL Server 2000 Accelerated Training [3 CDs], TransTrainer for Designing Microsoft SQL Server 2000 Databases v1.1, SQL Server 2000 Reporting Services,
MicroSoft SQL Server 2000, Service Pack 2, AppDev SQL Server 2000 Accelerated Training [3 CDs], TransTrainer for Designing Microsoft SQL Server 2000 Databases v1.1, SQL Server 2000 Reporting Services, (Enterprise), Developer Edition 64 Bit, other 16,000 more CDs, [ no dongles, no activations, etc ... needed ! ] (free donge)! No time limitation! CD NR 4203 MicroSoft SQL Server 2000 4in1 CD NR 9452 Microsoft SQL Server 2000 Service Pack 2 CD NR 11 298 AppDev SQL Server 2000 Accelerated Training [3 CDs] CD NR 12 000 Microsoft SQL Server 2000 Developer Edition 64 Bit CD NR 13 424 TransTrainer for Designing Microsoft SQL Server 2000 Databases v1.1 CD NR 14 688 SQL Server 2000 Reporting Services (c) Microsoft CD NR 15 412 SQL Server 2000 Reporting Services Enterprise (c) Microsoft please send e-mail, to ola2@mail.gr, zorba@mail.gr ...

Tools to extract data from SQL database and convert it into XML & insert XML data into SQL databases
As the subject said I am searching for a tool to extract data from SQL databases (e.g. MySQL) and convert it to an XML document. And vice versa a tool which enables me to insert a given XML data document into a (My)SQL database? Harry "Harry Zoroc" <harryzz@vodafone.com> wrote in message news:ccuvrq$dk$06$1@news.t-online.com... > As the subject said I am searching for a tool to extract data from SQL databases (e.g. MySQL) > and convert it to an XML document. www.intsysr.com/odbc2xml.htm > And vice versa a tool which enables me to insert a given XML data documen...

How to find SQL Servers & Databases in Each server using BATCH File?
Hi, I need help from you... I want to find SQL Servers which are available in Network and Databases in Each Server Using Batch file. If i run this Batch file it should find SQL Servers & Databases in each server and out put should send to txt file... Is it possible to do this using Batch file??? if possible hw can i??? Plz send me details hw to do... Thanx in Advance, Regards, Raghu Tumma... Mail to: raghutumma@gmail.com ...

Javascript validation against data on server
Hi everybody Javascript specialist, I am relatively new in Javascript world. I have a problem to solve and I hope one of you can help me. I am building a validation system, i.e. I want to validate data entered using A normal HTML FORM. Data will be checked using Javascript scripts to Have an immediate status, and to prevent user to keep on in case of error. But some data must be checked against MySql database accessed through PHP scripts. These PHP validate occur after user has hit <submit> button. I would like to retrieve MySql data from server and have them available for Immediate...

Transfering data from SQL Server Standard to SQL Server Express
Hello folks, Are there any tools that can transfer database and it's content from SQL Server Standard version to SQL Server Express database? I tried to backup database in SQL Server Standard and then restore it into SQL Server Express but it didn't work. Are there any tools that can extract SQL clauses to create database, tables and data inserts into file? Or any other method to transfer database/ data from SQL Server Standard to SQL Server Express? Cheers, (tapsavirtanen@yahoo.com) writes: > I tried to backup database in SQL Server Standard and then restore it > into SQL S...

Accessing SQL Server database from Javascript
Is it possible to access an SQL Server database from a Javascript client? I know you can transfer variables from middleware to Javascript client, but was wondering if you can directly access database from client? Thanks for any response. Scott "Scott Castillo" <scasti2@cox.net> wrote in message news:z0SWb.40310$P17.11527@fed1read03... >Is it possible to access an SQL Server database from a Javascript >client? I know you can transfer variables from middleware to >Javascript client, but was wondering if you can directly access >database from client? Javascript...

How To PROTECT SQL Server Database Files ?
Hello, How to protect structures(Tables,SP,Views and Functions) of a SQL Server Database?(Password protect a database file) I have a SQL database that will distribute with my application, I want to protects it's structure from my appliction users. Only my application can access the database. Thanks Hi Can not be done. An Access DB password can be cracked in minutes. Even if you could protect it, Profiler could trace what commands you send to the DB. Basic computer security principle: If someone has physical access to a computer or a DB, they can get to the data on the PC or database. ...

Extracting data from a SQL Server database
My client has a series of 4GL programs that do ETL of data from various Informix sources into a "data mart". It works like this: a 4GL program uses synonyms to extract data from remote live Informix databases and loads the data into a staging database. Another set of 4GLs extract this "staging" data and insert into into the data mart. Now they want to add a new database to the first part: that is, the extraction of the live data. Trouble is, this new database is a SQL Server one. Any opinions on the easiest way to achieve this? thanks Neil Truby t:01932 724027 Director m:07798 811708 Ardenta Limited e:neil.truby@ardenta.com Neil Truby wrote: > My client has a series of 4GL programs that do ETL of data from various > Informix sources into a "data mart". > It works like this: a 4GL program uses synonyms to extract data from > remote > live Informix databases and loads the data into a staging database. > Another set of 4GLs extract this "staging" data and insert into into the > data mart. > > Now they want to add a new database to the first part: that is, the > extraction of the live data. Trouble is, this new database is a SQL > Server one. > > Any opinions on the easiest way to achieve this? Am can use entreprise gateway manager? Or sql dts? -- Enor Neil Truby wrote: > My client has a...

Restore SQL Server 6.5 database in SQL Server 2000
Hi, Do you know if it is possible to restore database (backup) from SQL Server 6.5 in SQL Server 2000? Best Regards, Wojtek -- (Remove bez.syfu get my e-mail address) ...

Access database(Jet Engine) and SQL Server or SQL Server express
Hi, I am trying to find out what are the big differences between access database Jet engine and SQL Server? If I have serveral web applications (same content different copies) running as different sites(on IIS), each site using an access as a back-end database, all sites will be running simultaneously, all the access databases are on the same machine, on this approach, does each copy of access has its own Jet engine to handle database transaction or only has one Jet engine with multiple threads handles multiple copies of access database. Also, I'd like to know what kind database, and data...

move/copy database objects from SQL Server Express to SQL Server Standard??
Can anyone refer me to good 'recipes' or sources of information on this topic?? I have Visual Studio Tools for Office, which installs SS 2005 Express locally to my XP box, and I want to develop in SS 2005, then copy the tables or queries or reports etc. to a SS 2005 Standard server. Thank you, Tom Hi Tom If the objects are on source code control you may just want to check out the scripts and run them through SQLCMD. If you want the whole database then you can either use backup/restore or sp_detach_db/sp_attach_db, failing that you could use the import/export wizard, If SQLExpr...

Link from database form to .jpg file on server
I am trying to insert a hyperlink field which will link to a JPEG file in a folder on a server but for some reason, I am unable to do so. I can enter the same information in a browser, and it pulls up the image that I want. Doesn't Access like JPGs? Thanks, Bruce There are three approaches to handling images in Access illustrated in the sample databases that you can download from http://accdevel.tripod.com. None of them use hyperlink, but all work for me with .jpg files. Take a look and see if they are useful. Larry Linson Microsoft Access MVP "B Love" <blove2651@ch...

Access to Progress data files from SQL Server
All, Hello. Glad I found this group. :) I've got a backup of a Progress 8.3 database that I need to access and eventually port into MS SQL Server. Haven't figured out a way to do this, and any/all help anyone can provide will be greatly appreciated. Thanks! Dave As far as I know, nothing can read a Progress 8.3 database, except Progress 8.3, on the same platform it was created on. (you can't reliably read an 8.3 Unix database with Windows 8.3.) Once you get a Progress environment to work with, you'll want to dump the data. This will put the data into ascii files that you can work with. "Matisse" <mostly5@gmail.com> wrote in message news:1135480383.702974.19580@g49g2000cwa.googlegroups.com... > All, > > Hello. Glad I found this group. :) > > I've got a backup of a Progress 8.3 database that I need to access and > eventually port into MS SQL Server. > > Haven't figured out a way to do this, and any/all help anyone can > provide will be greatly appreciated. > > Thanks! > > Dave > In article <1135480383.702974.19580@g49g2000cwa.googlegroups.com>, "Matisse" <mostly5@gmail.com> wrote: > All, > > Hello. Glad I found this group. :) > > I've got a backup of a Progress 8.3 database that I need to access and > eventually port into MS SQL Server. > > Haven't figured out a way to do this...

SQL Server files after upgrading an Access database
Hi all I have upgraded an Access data file to SQL Server using the wizard (Access XP, 2000 file format). There seems to be no way to direct the SQL Server database files to a specified folder during this process. I now have the SQL Server database residing on a server on drive C: but it would be better on drive E: Does anyone know of a simple way to move the SQL Server database or force the upgrade to go to a specified folder? I know little about SQL Server, so please be gentle ... Thanks Jeff Hi Jeff, I have never used the upsizing wizard, but to move a sql server database from one ...

Cluster Database Failover Data in SQL Server?
Is there a method to determine if a cluster has failed over via data stored in SQL Server? I'm looking for a method to determine if a failover has occurred by running a script of some sort (i.e. T-Sql, Shell Script, etc). Any ideas? ...

Access2003
This is the vba code Set db =3D CurrentDb On error goto fErr =85. loop strSql =3D "UPDATE tblInvAnalysisWhse" & _ " SET ltDeviation =3D " & Sqr(dblError / intPeriods) & _ " WHERE item =3D '" & Trim(strItem) & "'" & _ " AND location =3D " & intLocation dblCount =3D dblCount + 1 db.Execute strSql, dbFailOnError fErr: stop resume next db.execute always fails after 1246 iterations, with - [Microsoft][ODB...

Sql Server backup vs HP Data Protector (HPDP) -- Do *not* use SQL Server?
Our HP representatives are telling us that backing/restoring our MS SQL Servers with "HP Data Protector (HPDP)" is better and safer than using MS Sql's backup/restore process. I have strong hesitations, because MS Sql's processes gives us a great deal of flexability. Has anyone have any experience wsith "HP Data Protector (HPDP)"? I worked with HPDP and don't see any features why it would be safer or better than SQL backup. In fact I found it much harder to configure, but to be honest it did the job. What I remember as particular annoying was that you coul...

How can I produce multiple output flat files from a single SQL file with multiple SQL statements?
Hi Folks, I'm used to a UNLOAD command that allows me to dump to a named flat file the results of any SELECT statement. Hence one can build a single SQL file which contains multiple SQL statements each of which 'unloads' to its own unique file. unload to 'file1.txt' select * from ...... unload to 'file2.txt' select * from ...... and so on.... I have a requirement to write a stop gap set of SQL to dump 10 flat files from SQL server 2005. I'd like to gather all these SQL statements into 1 or 2 SQL files so Ops have an easy life running them and to remove as mu...

Transfer Database from one Pervasive SQL 2000i server to Another Pervasive SQL 2000i Server
Any tips on how to transfer the data files from one Pervasive SQL 2000i database to another Pervasive SQL 2000i database. Please advice ASAP Thanks Sajid Saeed Simply copy the files from one server to the other. Sajid Saeed wrote: > Any tips on how to transfer the data files from one Pervasive SQL > 2000i database to another Pervasive SQL 2000i database. > > Please advice ASAP > > Thanks > > Sajid Saeed If you are just wanting the whole database from one server on another copy the files over. May need to set up an engine DSN on the new server for SQL/ODBC acce...

Write table data into flat file(.csv,.txt) and again read it from flat file(.csv,.txt)
Hi database Community, I have following specification with me 1>New Database(9.2) at place A 2>Old Database(9.2) at place B Now i want to transfer table data at Place A into flat file(.csv,.txt etc.) And again re read flat file data and put it into table at place B In short i want write data into flat file and read data from flat file. Could anyone tell me what is better way to achieve this. I am Beginner (practice purpose) If possible give some link for downloading the tutorial Thanking in advance Sanjeev N.A. "sanjeev" <sanjeev_atvankar@yahoo.co.in> a �crit...

RE: Extracting data from a SQL Server database #2
sorry, i was thinking you want to extract data from informix, anyway to extract data from sqlserver you can use the same approach, 1) create linkserver using odbc source for informix db and write dts package in sqlserver to extract the data from sqlserver and load in the informix database 2) use bcp utility of sqlserver to extradct data from sqlserver -----Original Message----- From: Savio Pinto (s) Sent: Tuesday, May 04, 2004 9:50 AM To: 'Neil Truby'; informix-list@iiug.org Subject: RE: Extracting data from a SQL Server database here are couple of option that i could think of 1) sqlserver has something called as linked servers where you can link other database like db2, oracle,i think they don't have anything for informix, but you can create a linked server to access an ODBC database using an ODBC data source to connect to the informix database, this way you can extract data from informix database and load it to the sqlserver database using sqlserver routines or DTS packages to pull the data. 2)you can do the extract from the informix 4gl programs and unload to a delimited file, then use the sql server bcp utility to load the delimited file in the sql server database. -----Original Message----- From: owner-informix-list@iiug.org [mailto:owner-informix-list@iiug.org]On Behalf Of Neil Truby Sent: Tuesday, May 04, 2004 8:44 AM To: informix-list@iiug.org Subject: Extracting data from a SQL Server database My client ha...

Creating a Format Library from data in a SQL Server Database
Hi , I am currently creating Format Librarys using this peice of code: proc FORMAT; value manual 4 = 'missing' 3 = 'N/A' 2 = 'refused' 1 = 'accepted' ; value provide 4 = 'missing' 3 = 'N/A' 2 = 'refused' 1 = 'D/K' ; value patient A = 'new' B = 'existing' ...

Filter by form problem with Yes/No Data and SQL Server
Using Access 2003 front end; SQL Server 2005 Back end: I have a complex form that has lots of data fields including about thirty or so checkboxes storing Yes/No data that I would like my users to be able to use the Filter by Form functionality with to create a "Custom" query. This works perfectly fine when I filter on a text field. Also, this works perfectly fine for all data with an Access Back end. When I use boolean data and my SQL server back end, however, the filter stops working. I understand that the SQL server stores the Yes as "1" while Access, and my "Filte...

Web resources about - Validating form data against a SQL Server database or flat file - comp.lang.javascript

Talking to police about Ghomeshi allegations was validating: Decoutere
One of the women accusing former CBC host Jian Ghomeshi of violent behaviour is encouraging other potential victims not to be afraid of speaking ...

Validating Input and Interprocess Communication
Describes techniques to use and factors to consider to make your code more secure from attack.

Startup For Validating Your Ideas
Test4startup promises its service lets you to see if your idea is promising enough before you develop a working prototype. "Using artificial ...

Validating team-by-team R and RBI predictions for 2012 AL Edition
Unless you're a big fan of my writing, you may not know that at this time last year, I wrote for a different SB Nation site: the dearly departed ...

"It is important not to create a precedent validating the prohibition of the sale of any object of a ...
"... regardless of the culture concerned... Our goal has always been to showcase Hopi culture and make it accessible to the largest number of ...

Validating the Donald
Validating the Donald by digby In Salon today , I wrote about the right wing media's immigration backlash strategy by validating Donald Trump's ...

Validating your marketing audience
... enjoyed this, please share it with your network! Want to read more like this from Christopher Penn ? Get daily updates now: The post Validating ...

Validating Albert Einstein, physicists make major discovery about the early universe
In the beginning there was the Big Bang. What we know about this time is that the universe was extremely hot, dense and almost uniform; it was ...

Validating Architecture through LINQ Query
... is simple enough to get validated at a glance. But at a glance is not enough. What about defining custom rules that take care of validating ...

From Data to Action – Best Practices for Validating and Optimizing Your Digital Campaigns - comScore ...
In this webinar, comScore Senior Industry Analyst Jason Patterson explores how you can use comScore's validated data to optimize and improve ...

Resources last updated: 3/12/2016 6:53:21 AM