Wednesday, August 11, 2010

How to save a list of rows of a datagrid in adodc in VB6?

Hi, I have list of rows in a datagrid and what I want to do is to save them all in a database linked in a adodc when I press a command button. How can I do it? Please helpHow to save a list of rows of a datagrid in adodc in VB6?
I'm not sure if I will be of any help because I am more a .NET person.





You can use SQL (or similar) INSERT INTO like this:





INSERT INTO TABLE2 (COL1, COL2, COL3) SELECT COL1, COL4, COL7 FROM TABLE1





As you can see from the above example that the SELECT statement probably looks just like the one you used to put the data in the datatable. You would run a function that is triggered with the command button and it can add the original select statement appended to the INSERT INTO part.

No comments:

Post a Comment