How to insert record into table 
Author Message
 How to insert record into table

How can I insert the name input by the user into the table

My segment code is as below:

NameField = txtName.Text
rs.Open "INSERT INTO myTestTable (FirstName) VALUES (NameField)"

the NameField is inserted instead of the user input name.

thanks
sllai



Sat, 10 May 2003 03:00:00 GMT  
 How to insert record into table
Always put your variables in Quotes.

rs.Open "INSERT INTO myTestTable (FirstName) VALUES ('" & NameField & "')"

Just copy the above line to your code, otherwise you might left the quotes.
Please note, there is a Single Quote after (  bracket and before ) bracket.

Best Regards,

Luqman


Quote:
> How can I insert the name input by the user into the table

> My segment code is as below:

> NameField = txtName.Text
> rs.Open "INSERT INTO myTestTable (FirstName) VALUES (NameField)"

> the NameField is inserted instead of the user input name.

> thanks
> sllai



Sun, 11 May 2003 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. how to insert record into table of html by ADO

2. Variable Table Names in Create Tables/Insert Records

3. Inserting large number of records into a large table with SQL/DAO

4. Insert record into indexed table

5. how to get Error when inserting record in Access Table

6. Inserting records from one database table to another in SQL Server

7. Insert into adds 64 times the records of the table

8. Insert record into Access Table

9. Insert records in 2 tables

10. .AddNew inserts records into middle of table

11. Need help with inserting records into an access table

12. Inserting records into a DB table.

 

 
Powered by phpBB® Forum Software