-
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!!!
-
<?>
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)
-
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