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

Recommended Answers

All 2 Replies

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

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.