Question:

How to insert record in a blank table of MS ACCESS through VB6 give full source code please?

by  |  earlier

0 LIKES UnLike

How to insert record in a blank table of MS ACCESS through VB6 give full source code please?

 Tags:

   Report

1 ANSWERS


  1. To insert a record into a table (let's all it tblX) you must insert at least one field value (plus foreign key values in a related table)

    The steps are to create an SQL string and then use the DoCmd.  For two fields it looks like

    strSQL = "INSERT INTO tblX (field1, field2) VALUES (value1, value2);"

    DoCmd.RunSQL strSQL

    Where value1 is the data to be inserted into field1.  String data must be delimited by 'single quotes' and dates constants must be delimited by #hash signs#.

    You can combine the two statements into one, but I generally like the option to put a breakpoint at the DoCmd line to check the SQL, so I keep it at two statements.

    Hope that helps

Question Stats

Latest activity: earlier.
This question has 1 answers.

BECOME A GUIDE

Share your knowledge and help people by answering questions.