Last post Jun 03, 2015 05:28 AM by Fei Han - MSFT
Jun 01, 2015 10:55 AM|mike4u|LINK
actually i have query : select * from employee
So on based on above query
on button click
i have to create MDB file containing all data of above query .
kindly suggest code.
Jun 01, 2015 02:28 PM|Nasser Malik|LINK
Do you want to export to access database ?
Jun 01, 2015 08:08 PM|mike4u|LINK
Jun 02, 2015 01:16 PM|Afzaal.Ahmad.Zeeshan|LINK
Actually you have not shown any code or attempt to create the MDB file. The query that you have shown is simply a SELECT query for extraction of data. To successfully execute the above command, you require,
Once that has been done, then this query would be executed. Otherwise, exceptions... Exceptions... Exceptions.
Anyways, there is a
good article on CodeProject that contains the necessary code to create the database, and create a table (Employee) to execute the SELECT command on it. :) I hope you would get much details from it.
Secondly, to trigger the code in button click, you can create a separate function with the statements to your required program.
Jun 03, 2015 05:28 AM|Fei Han - MSFT|LINK
Thanks for your post.
If you’d like to insert the query result into a new table, you could try to use SELECT INTO statement. SELECT INTO statement is used when table is not created earlier and needs to be created when data from one table is to be inserted into newly created table
from another table. New table is created with same data types as selected columns.
select * into [newemployee]
For more information about SELECT INTO statement, please refer to this link.