0

Im using an ADO data control to connect to an Access database .mdb

I can set the ConnectionString property correctly, but when I set the RecordSource to an SQL statement such as an INSERT statement in this format

INSERT INTO table_name (column1, column2,...)
VALUES (value1, value2,....)

it doesnt work

when i set the RecordSource to an INSERT statement in code, the RecordSource count fails to increase and the record is not added

when i set the RecordSource before run time though, it adds about seven instances of the same record relating to the same INSERT statement, as if its repeatedly added to the database

Could someone show me an example of setting the RecordSource to an INSERT sql statment

3
Contributors
2
Replies
3
Views
11 Years
Discussion Span
Last Post by NewVBguy
0

Im using an ADO data control to connect to an Access database .mdb

I can set the ConnectionString property correctly, but when I set the RecordSource to an SQL statement such as an INSERT statement in this format

INSERT INTO table_name (column1, column2,...)
VALUES (value1, value2,....)

it doesnt work

when i set the RecordSource to an INSERT statement in code, the RecordSource count fails to increase and the record is not added

when i set the RecordSource before run time though, it adds about seven instances of the same record relating to the same INSERT statement, as if its repeatedly added to the database

Could someone show me an example of setting the RecordSource to an INSERT sql statment

Hi,
I never use the query statement via the recordsource of the data control. But instead i use the edit, add, update method.

maybe i want to try your method too if you find a way to do it.

newvbguy

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.