Go Back   Computer Forums > General Computing > Programming
Click Here to Login
Join Computer forums Today


Reply
 
Thread Tools Search this Thread Display Modes
 
Old 04-30-2009, 03:09 AM   #1
In Runtime
 
akira282's Avatar
 
Join Date: Mar 2009
Posts: 172
Default Project help, trying to Create/Delete from access database

http://kyler282.googlepages.com/projecthelp.doc

Any help on how to get started with this would be great thanks. My hunch is I will create a static index table that first shows what it initially should have, then have buttons, etc
__________________

__________________
[CPU] Intel Core i7 920 @ 2.66 [MOBO] ASUS P6T Deluxe V2 [GPU] EVGA GeForce GTX 260 SCE 896MB 620MHz/216 core [RAM] G.Skill 6GB DDR3 1333 7-7-7-18 [HD] WD Cav Black 640GB 7200RPM [DRIVE] Samsung DVD/CD burner [PSU] OCZ 700w [MONITOR] LG 1080p, 1920x1080 23" 2ms GTG Widescreen LCD [KEYBOARD] Saitek Eclipse Blue [CASE] Antec 902[OS] Windows Vista 64bit Home Prem.
akira282 is offline   Reply With Quote
Old 04-30-2009, 10:38 AM   #2
In Runtime
 
Daeva's Avatar
 
Join Date: Dec 2005
Posts: 407
Send a message via AIM to Daeva Send a message via MSN to Daeva Send a message via Yahoo to Daeva
Default Re: Project help, trying to Create/Delete from access database

What language (server-side) does this have to be in? It sounds like fun.
__________________

__________________
**Official Self-proclaimed glorified excessive (insert additional adjectives here) post editor/modifier.
Edit = Best feature ever
http://www.twitter.com/xDaevax
Daeva is offline   Reply With Quote
Old 04-30-2009, 09:51 PM   #3
In Runtime
 
akira282's Avatar
 
Join Date: Mar 2009
Posts: 172
Default Re: Project help, trying to Create/Delete from access database

It needs to be java, but with js to do client side validation
__________________
[CPU] Intel Core i7 920 @ 2.66 [MOBO] ASUS P6T Deluxe V2 [GPU] EVGA GeForce GTX 260 SCE 896MB 620MHz/216 core [RAM] G.Skill 6GB DDR3 1333 7-7-7-18 [HD] WD Cav Black 640GB 7200RPM [DRIVE] Samsung DVD/CD burner [PSU] OCZ 700w [MONITOR] LG 1080p, 1920x1080 23" 2ms GTG Widescreen LCD [KEYBOARD] Saitek Eclipse Blue [CASE] Antec 902[OS] Windows Vista 64bit Home Prem.
akira282 is offline   Reply With Quote
Old 05-01-2009, 08:42 AM   #4
In Runtime
 
Daeva's Avatar
 
Join Date: Dec 2005
Posts: 407
Send a message via AIM to Daeva Send a message via MSN to Daeva Send a message via Yahoo to Daeva
Default Re: Project help, trying to Create/Delete from access database

Ok, what did you learn in your class, servlets or JSP, or both? If both, does it matter which method you use?
__________________
**Official Self-proclaimed glorified excessive (insert additional adjectives here) post editor/modifier.
Edit = Best feature ever
http://www.twitter.com/xDaevax
Daeva is offline   Reply With Quote
Old 05-01-2009, 01:59 PM   #5
In Runtime
 
akira282's Avatar
 
Join Date: Mar 2009
Posts: 172
Default Re: Project help, trying to Create/Delete from access database

Yup, I'm using servlets, jsps and of course java models

So far Ive done the following: The user first sees a page that says "TO begin, click!" and the user clicks" The servlet makes a query and shows a view of the Actor's table. Where I then have two forms one for add, the other for delete.

That's where Im at now.

Well, I'm pretty much done. I need help adding JS validation for dates. Is it possible to put two functions to one onsubmit?

Anyway, any help with this would be cool.
__________________
[CPU] Intel Core i7 920 @ 2.66 [MOBO] ASUS P6T Deluxe V2 [GPU] EVGA GeForce GTX 260 SCE 896MB 620MHz/216 core [RAM] G.Skill 6GB DDR3 1333 7-7-7-18 [HD] WD Cav Black 640GB 7200RPM [DRIVE] Samsung DVD/CD burner [PSU] OCZ 700w [MONITOR] LG 1080p, 1920x1080 23" 2ms GTG Widescreen LCD [KEYBOARD] Saitek Eclipse Blue [CASE] Antec 902[OS] Windows Vista 64bit Home Prem.
akira282 is offline   Reply With Quote
Old 05-01-2009, 09:28 PM   #6
In Runtime
 
Daeva's Avatar
 
Join Date: Dec 2005
Posts: 407
Send a message via AIM to Daeva Send a message via MSN to Daeva Send a message via Yahoo to Daeva
Default Re: Project help, trying to Create/Delete from access database

You can make two function calls, consider this page here. This is a site we are about to finish up at my company. The form uses some client side validation I wrote. It works pretty well.
http://www.tritg.com/teton/contact.php

Here is the associated script separated from the page.

Code:
function validateForm(obj){

var me = this;

me.isValid = true;

var firstEmail;

for(i=0;i<obj.elements.length;i++){

var currentInput = obj.elements[i];

 var outputName = currentInput.id + "opt";

 switch(obj.elements[i].name){

  case "uname":

   if(currentInput.value.length == 0){

      document.getElementById(outputName).style.visibility="visible";

	  document.getElementById(outputName).style.color="red";

	  document.getElementById(outputName).style.display="block";

	  document.getElementById(outputName).innerHTML = "Please enter your name.";

	  me.isValid = false;

   }else{

      document.getElementById(outputName).style.visibility="hidden";

	  document.getElementById(outputName).style.display="none";

	  document.getElementById(outputName).style.color="";

	  document.getElementById(outputName).innerHTML = "";

   }//end of if

   break;

  case "phoneNum":

   var phoneExpression = /^[0-9]{10}$/;

   if(currentInput.value.match(phoneExpression) && currentInput.value.length > 0){

      document.getElementById(outputName).style.visibility="hidden";

	  document.getElementById(outputName).style.display="none";

      document.getElementById(outputName).style.color="";

	  document.getElementById(outputName).innerHTML = "";

   }else if(currentInput.value.length > 0 && !currentInput.value.match(phoneExpression)) {

      document.getElementById(outputName).style.visibility="visible";

	  document.getElementById(outputName).style.color="red";

	  document.getElementById(outputName).style.display="block";

	  document.getElementById(outputName).innerHTML = "Please enter a valid phone number.";

	  me.isValid = false;

	} else {

	  document.getElementById(outputName).style.visibility="hidden";

	  document.getElementById(outputName).style.display="none";

	  document.getElementById(outputName).style.color="";

	  document.getElementById(outputName).innerHTML = "";

	} // end if/else

   break;

  case "email":

   var emailExpression = /([a-zA-z0-9\.\-]+)@([a-zA-Z0-9\.\-]+)\.([a-zA-Z]{2,3})/;

   var firstEmail = currentInput.value;

   if(currentInput.value.length == 0){

      document.getElementById(outputName).style.visibility="visible";

	  document.getElementById(outputName).style.color="red";

	  document.getElementById(outputName).style.display="block";

	  document.getElementById(outputName).innerHTML="Please enter your e-mail address.";

	  me.isValid = false;

   }else if(!currentInput.value.match(emailExpression)){

      document.getElementById(outputName).style.visibility="visible";

	  document.getElementById(outputName).style.color="red";

	  document.getElementById(outputName).style.display="block";

	  document.getElementById(outputName).innerHTML="Please check your e-mail address to make sure it is valid.";

	  me.isValid = false;

   }else if(currentInput.value.match(emailExpression)){

      document.getElementById(outputName).style.visibility="hidden";

	  document.getElementById(outputName).style.display="none";

      document.getElementById(outputName).style.color="";

	  document.getElementById(outputName).innerHTML="";

   }//end of if

   break;

  case "email2":

  //alert(firstEmail);

  //alert(currentInput.value);

   if(currentInput.value != firstEmail){

      document.getElementById(outputName).style.visibility="visible";

      document.getElementById(outputName).style.color="red";

	  document.getElementById(outputName).style.display="block";

	  document.getElementById(outputName).innerHTML="Please make sure your e-mail addresses match.";

	  me.isValid = false;

   }else{

      document.getElementById(outputName).style.visibility="hidden";

	  document.getElementById(outputName).style.display="none";

      document.getElementById(outputName).style.color="";

	  document.getElementById(outputName).innerHTML="";

   }

   break;

  /*case "content1":

   if(currentInput.value.length == 0){

      document.getElementById(outputName).style.visibility="visible";

   	  document.getElementById(outputName).style.color="red";

	  document.getElementById(outputName).style.display="block";

	  document.getElementById(outputName).innerHTML="Input your question and/or comment.";

	  me.isValid = false;

   }else{

      document.getElementById(outputName).style.visibility="hidden";

	  document.getElementById(outputName).style.display="none";

      document.getElementById(outputName).style.color="";

	  document.getElementById(outputName).innerHTML = "";

   } //end of if

  break;*/

 }//end of switch

 }//end of for loop

 if (!me.isValid) {

   document.getElementById("userError").style.visibility = "visible";

   document.getElementById("userError").innerHTML = "There were some problems submitting your information.  Please check all of the highlighted items and try again.";

 } else {

   document.getElementById("userError").style.visibility = "hidden";

   document.getElementById("userError").innerHTML = "";

 } // end if/else

 return me.isValid;

}//end of function validateForm



function clearErrors() {

  document.getElementById("userError").style.visibility = "hidden";

  for(i=0;i<document.getElementById("formError").childNodes.length;i++) {

    document.getElementById("formError").childNodes[i].innerHTML = "";

  } // end for loop

} // end function clearErrors
The form isn't running yet, so you can play with submitting it without worrying about submitting info if you want, to test what the script does.

Hope that helps.
__________________
**Official Self-proclaimed glorified excessive (insert additional adjectives here) post editor/modifier.
Edit = Best feature ever
http://www.twitter.com/xDaevax
Daeva is offline   Reply With Quote
Old 05-02-2009, 04:20 PM   #7
In Runtime
 
akira282's Avatar
 
Join Date: Mar 2009
Posts: 172
Default Re: Project help, trying to Create/Delete from access database

Quote:
Originally Posted by Daeva View Post
You can make two function calls, consider this page here. This is a site we are about to finish up at my company. The form uses some client side validation I wrote. It works pretty well.
http://www.tritg.com/teton/contact.php

Here is the associated script separated from the page.

Code:
function validateForm(obj){

var me = this;

me.isValid = true;

var firstEmail;

for(i=0;i<obj.elements.length;i++){

var currentInput = obj.elements[i];

 var outputName = currentInput.id + "opt";

 switch(obj.elements[i].name){

  case "uname":

   if(currentInput.value.length == 0){

      document.getElementById(outputName).style.visibility="visible";

	  document.getElementById(outputName).style.color="red";

	  document.getElementById(outputName).style.display="block";

	  document.getElementById(outputName).innerHTML = "Please enter your name.";

	  me.isValid = false;

   }else{

      document.getElementById(outputName).style.visibility="hidden";

	  document.getElementById(outputName).style.display="none";

	  document.getElementById(outputName).style.color="";

	  document.getElementById(outputName).innerHTML = "";

   }//end of if

   break;

  case "phoneNum":

   var phoneExpression = /^[0-9]{10}$/;

   if(currentInput.value.match(phoneExpression) && currentInput.value.length > 0){

      document.getElementById(outputName).style.visibility="hidden";

	  document.getElementById(outputName).style.display="none";

      document.getElementById(outputName).style.color="";

	  document.getElementById(outputName).innerHTML = "";

   }else if(currentInput.value.length > 0 && !currentInput.value.match(phoneExpression)) {

      document.getElementById(outputName).style.visibility="visible";

	  document.getElementById(outputName).style.color="red";

	  document.getElementById(outputName).style.display="block";

	  document.getElementById(outputName).innerHTML = "Please enter a valid phone number.";

	  me.isValid = false;

	} else {

	  document.getElementById(outputName).style.visibility="hidden";

	  document.getElementById(outputName).style.display="none";

	  document.getElementById(outputName).style.color="";

	  document.getElementById(outputName).innerHTML = "";

	} // end if/else

   break;

  case "email":

   var emailExpression = /([a-zA-z0-9\.\-]+)@([a-zA-Z0-9\.\-]+)\.([a-zA-Z]{2,3})/;

   var firstEmail = currentInput.value;

   if(currentInput.value.length == 0){

      document.getElementById(outputName).style.visibility="visible";

	  document.getElementById(outputName).style.color="red";

	  document.getElementById(outputName).style.display="block";

	  document.getElementById(outputName).innerHTML="Please enter your e-mail address.";

	  me.isValid = false;

   }else if(!currentInput.value.match(emailExpression)){

      document.getElementById(outputName).style.visibility="visible";

	  document.getElementById(outputName).style.color="red";

	  document.getElementById(outputName).style.display="block";

	  document.getElementById(outputName).innerHTML="Please check your e-mail address to make sure it is valid.";

	  me.isValid = false;

   }else if(currentInput.value.match(emailExpression)){

      document.getElementById(outputName).style.visibility="hidden";

	  document.getElementById(outputName).style.display="none";

      document.getElementById(outputName).style.color="";

	  document.getElementById(outputName).innerHTML="";

   }//end of if

   break;

  case "email2":

  //alert(firstEmail);

  //alert(currentInput.value);

   if(currentInput.value != firstEmail){

      document.getElementById(outputName).style.visibility="visible";

      document.getElementById(outputName).style.color="red";

	  document.getElementById(outputName).style.display="block";

	  document.getElementById(outputName).innerHTML="Please make sure your e-mail addresses match.";

	  me.isValid = false;

   }else{

      document.getElementById(outputName).style.visibility="hidden";

	  document.getElementById(outputName).style.display="none";

      document.getElementById(outputName).style.color="";

	  document.getElementById(outputName).innerHTML="";

   }

   break;

  /*case "content1":

   if(currentInput.value.length == 0){

      document.getElementById(outputName).style.visibility="visible";

   	  document.getElementById(outputName).style.color="red";

	  document.getElementById(outputName).style.display="block";

	  document.getElementById(outputName).innerHTML="Input your question and/or comment.";

	  me.isValid = false;

   }else{

      document.getElementById(outputName).style.visibility="hidden";

	  document.getElementById(outputName).style.display="none";

      document.getElementById(outputName).style.color="";

	  document.getElementById(outputName).innerHTML = "";

   } //end of if

  break;*/

 }//end of switch

 }//end of for loop

 if (!me.isValid) {

   document.getElementById("userError").style.visibility = "visible";

   document.getElementById("userError").innerHTML = "There were some problems submitting your information.  Please check all of the highlighted items and try again.";

 } else {

   document.getElementById("userError").style.visibility = "hidden";

   document.getElementById("userError").innerHTML = "";

 } // end if/else

 return me.isValid;

}//end of function validateForm



function clearErrors() {

  document.getElementById("userError").style.visibility = "hidden";

  for(i=0;i<document.getElementById("formError").childNodes.length;i++) {

    document.getElementById("formError").childNodes[i].innerHTML = "";

  } // end for loop

} // end function clearErrors
The form isn't running yet, so you can play with submitting it without worrying about submitting info if you want, to test what the script does.

Hope that helps.
What does this script do?
__________________
[CPU] Intel Core i7 920 @ 2.66 [MOBO] ASUS P6T Deluxe V2 [GPU] EVGA GeForce GTX 260 SCE 896MB 620MHz/216 core [RAM] G.Skill 6GB DDR3 1333 7-7-7-18 [HD] WD Cav Black 640GB 7200RPM [DRIVE] Samsung DVD/CD burner [PSU] OCZ 700w [MONITOR] LG 1080p, 1920x1080 23" 2ms GTG Widescreen LCD [KEYBOARD] Saitek Eclipse Blue [CASE] Antec 902[OS] Windows Vista 64bit Home Prem.
akira282 is offline   Reply With Quote
Old 05-02-2009, 11:06 PM   #8
In Runtime
 
Daeva's Avatar
 
Join Date: Dec 2005
Posts: 407
Send a message via AIM to Daeva Send a message via MSN to Daeva Send a message via Yahoo to Daeva
Default Re: Project help, trying to Create/Delete from access database

That script is responsible for the client-side validation.
__________________
**Official Self-proclaimed glorified excessive (insert additional adjectives here) post editor/modifier.
Edit = Best feature ever
http://www.twitter.com/xDaevax
Daeva is offline   Reply With Quote
Old 05-03-2009, 12:44 AM   #9
In Runtime
 
akira282's Avatar
 
Join Date: Mar 2009
Posts: 172
Default Re: Project help, trying to Create/Delete from access database

And what exactly is it validating again?
__________________
[CPU] Intel Core i7 920 @ 2.66 [MOBO] ASUS P6T Deluxe V2 [GPU] EVGA GeForce GTX 260 SCE 896MB 620MHz/216 core [RAM] G.Skill 6GB DDR3 1333 7-7-7-18 [HD] WD Cav Black 640GB 7200RPM [DRIVE] Samsung DVD/CD burner [PSU] OCZ 700w [MONITOR] LG 1080p, 1920x1080 23" 2ms GTG Widescreen LCD [KEYBOARD] Saitek Eclipse Blue [CASE] Antec 902[OS] Windows Vista 64bit Home Prem.
akira282 is offline   Reply With Quote
Old 05-04-2009, 07:25 AM   #10
Beta Member
 
Join Date: May 2009
Posts: 2
Default Re: Project help, trying to Create/Delete from access database

The Code Project .... Generally, one of the first steps when you are trying to work with ..... Maybe enybody know how to join MS Access database and MS SQL 2005 ... How to create a MSSQL ( or MSSQL2005 Express) database using ADO ( Not ADO. ... how to save,search,delete and edit a record into the database using ...
__________________

masudkarim is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off



All times are GMT -5. The time now is 04:56 PM.


Powered by vBulletin® Version 3.8.8 Beta 4
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
Search Engine Friendly URLs by vBSEO 3.6.0