Inserting values from a text box into a database with SQL


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: Inserting values from a text box into a database with SQL

  1. #1
    blake Guest

    Inserting values from a text box into a database with SQL


    I can't seem to take the info typed into a text box and use it in my ADO execute
    SQL statement to insert it into the appropriate fields. Does anyone know
    how to accomplish this? I'm sure its easy, but it escapes me right now and
    is really holding up my app.....thanks very much

    for example......
    I've got a text box named txtOne
    After declaring my connection object and the connection string and opening
    the object...I try a conn.execute "Insert into Personal(Name) Values(txtOne.text),
    1"
    I get an error stating that a required parameter is missing...if I change
    txtONe.text to something like 'Blake'..it inserts it into the table no problem...how
    do I get the value of txtOne into the table????

  2. #2
    Arthur Wood Guest

    Re: Inserting values from a text box into a database with SQL


    Blake,
    Your Execute should look like this:

    conn.execute "Insert into Personal(Name) Values(" & txtOne.text & "),1"


    note that the VALUE of txtOne.Text must be concatenated into the command.

    Arthur Wood

    "blake" <polychemist@yahoo.com> wrote:
    >
    >I can't seem to take the info typed into a text box and use it in my ADO

    execute
    >SQL statement to insert it into the appropriate fields. Does anyone know
    >how to accomplish this? I'm sure its easy, but it escapes me right now and
    >is really holding up my app.....thanks very much
    >
    >for example......
    >I've got a text box named txtOne
    >After declaring my connection object and the connection string and opening
    >the object...I try a conn.execute "Insert into Personal(Name) Values(txtOne.text),
    >1"
    >I get an error stating that a required parameter is missing...if I change
    >txtONe.text to something like 'Blake'..it inserts it into the table no problem...how
    >do I get the value of txtOne into the table????



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center