Results 1 to 3 of 3

Thread: sql statement

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Sep 2000
    Posts
    103
    using an SQL Statment to insert a new record into my database
    how would i add the contents of my text1 textbox to my database called TESTERSQL and fieldname "Test"

    thanks
    im learning sql querys at the moment can any one tell me as well where there are good sql tutorials!!!

  2. #2
    _______ HeSaidJoe's Avatar
    Join Date
    Jun 1999
    Location
    Canada
    Posts
    3,946

    <?>

    The following example opens the employee table and adds one record.

    USE employee
    INSERT INTO employee (emp_no, fname, lname, officeno) ;
    VALUES (3022, "John", "Smith", 2101)

    "A myth is not the succession of individual images,
    but an integerated meaningful entity,
    reflecting a distinct aspect of the real world."

    ___ Adolf Jensen

  3. #3
    Fanatic Member Wen Lie's Avatar
    Join Date
    Jul 1999
    Location
    Singapore
    Posts
    524

    Wink

    Use INSERT INTO ....blablabla....

    The statement is :

    From VB :
    If Text1 content is a Text
    Code:
    Dim myConn as New ADODB.Connection
    
    myConn.Open "your connection string open"
    
    myConn.Execute "INSERT INTO TESTERSQL(Test) " _
    & "select '" & Trim(Text1.Text) & "'"
    If Text1 content is a value
    Code:
    Dim myConn as New ADODB.Connection
    
    myConn.Open "your connection string open"
    
    myConn.Execute "INSERT INTO TESTERSQL(Test) " _
    & "select " & Trim(Text1.Text) & ""
    I hope it will help...

    Cheers,
    Wen Lie
    Regards,
    [-w-]

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width