RE: Submit Button
- From: "Chris" <Chris@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Mon, 30 Jan 2006 09:50:36 -0800
Thanks Matt, but I worked with this code you provided for quite sometime with
no luck. I kinda figured that this would be a rather straight forward
project, but Visual Studio makes it so difficult. Just adding code to a
simple Submit button to get data into a database is turing into too much.
Chris A
"mattb" wrote:
>
>
> "Chris" wrote:
>
> > Anyone have any other ideas on this?
> >
> > Chris A
> >
> > "Chris" wrote:
> >
> > > Thanks but I am not sure what to do with this code. I am looking for code
> > > that will take the data enterted into the form and put it into the database
> > > when I click on the submit button.
> > >
> > > Chris
> > >
> > > "GrandMaMa" wrote:
> > >
> > > > Chris;
> > > > The best method that I use is to create a Java Script Sub-Routine.
> > > > Yon can then have as many Submit Buttons as you want or just one to check the
> > > > information entered.
> > > >
> > > > Here is the code for one of my pages.
> > > >
> > > > <Script Language="JavaScript">
> > > >
> > > > function ChangeRecord(){
> > > > boolValid = false;}
> > > > var qqqqqq = document.FORM1.txtGCPHNO.value.length;
> > > > if (qqqqqq < 2){
> > > > var incomplete = "You Must Enter A Valid Phone Number or Extension For
> > > > The Guidance Counselor. The Format for the Phone Number Must Be NNN-NNNN";
> > > > alert(incomplete);
> > > > var boolValid = true;
> > > > if (boolValid==true){
> > > > document.FORM1.action = "CPAGEC.Asp";
> > > > document.FORM1.submit();}
> > > > }
> > > >
> > > > function ChangePassword(){
> > > > document.FORM1.action = "CPAGED.Asp";
> > > > document.FORM1.submit();
> > > > }
> > > >
> > > > </Script>
> > > >
> > > > <p><Input Type="Button" Value="Submit Information" Name="B1"
> > > > OnClick="ChangeRecord();"><input TYPE="reset" value="Reset" name="B2">
> > > >
> > > > Good Luck
> > > >
> > > > Granny
> > > >
> > > >
> > > > "Chris" wrote:
> > > >
> > > > > I have created a form with many inout boxes, all input boxes have unique
> > > > > names. I have a SQL database with just a few entries which relate to the
> > > > > form. I have a submit button on the form and I am trying to code that button
> > > > > to add the data entered on the form into the database.
> > > > >
> > > > > I have a SqlDataAdapter, SqlConnection to my form. Can someone please help
> > > > > me with my code for the submit button? I believe I need an Insert statement.
> > > > >
> > > > > Thanks, Chris A
> 'this iste helps with the different parts you need
> http://www.aspin.com/
> search on connections, forms, request.form, validate, add records, close
> connections, etc
>
>
> setup conn
> set Conn = CreateObject("ADODB.Connection")
>
> 'SQL CONNECTION
> 'Conn.Open = "Provider=SQLOLEDB.1;Initial Catalog=DATABASE;Data
> Source=SERVER;User Id=;PASSWORD=;"
>
> 'ACCESS CONNECTION'
> Conn.Open = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\DBASE.mdb;User
> Id=Admin;Password=; "
>
> 'PUT IN FORMS WITH INPUT DATA
>
> 'SEND DATA TO ANOTHER PAGE TO VALIDATE
>
> 'PULL DATA FROM PREV PAGE & VALIDATE
>
> 'ADD INTO DB from new page
>
> ' this is a type of adding for access
> SQLAdd = " SELECT * FROM TABLE "
>
> Set rs = Server.CreateObject("ADODB.Recordset")
> rs.Open SQLAdd, Conn, adOpenKeyset,3
>
> rs.AddNew
>
> rs.Fields("Field1") = varField1
>
> rs.update
>
> 'close rs & connections
> rs.Close
> Set rs=nothing
> Conn.close
> Set Conn=nothing
>
>
>
>
.
- References:
- RE: Submit Button
- From: mattb
- RE: Submit Button
- Prev by Date: Re: script to create user accounts
- Next by Date: A script to Zip
- Previous by thread: RE: Submit Button
- Next by thread: Re: Submit Button
- Index(es):
Loading