locked
Open Access file from asp.net RRS feed

  • Question

  • User546194788 posted

    I need to embed one Access app in a asp.net app. (open mdb/mde file from asp.net)
    There are may queries including crosstab queies and reports in Access app.
    How to open it from a button in asp.net so that user can run query or report from Access?
    Is there third party tool to do it?

    Friday, February 18, 2011 9:19 AM

Answers

  • User-1199946673 posted

    When using and Access file in a web environment, you need to connect using Oledb. But be aware that at that moment, you're not dealing with Access, but with a Jet Database Engine. That means that you can only access the tables and query's in the file. You cannot access other objects like forms, reports and modules.. Also, in the query's you can only use functions that are supported by Jet. queries that use functions you made in modules will fail. That's the way it is. When you want to run queries, the easiest way is to use an SQLDatasource of AccessDataspource and bind that to a gridview

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, February 18, 2011 10:52 AM

All replies

  • User794480159 posted

    Hi,

    You can use OleDbConnection to connect to access database. Then you can run your sql queries against it using ADO.net. To display the records, use data binding controls like datagrid or gridview in asp.net.

    See the below link

    http://msdn.microsoft.com/en-us/library/ms971485.aspx

    Hope it will help.

    Friday, February 18, 2011 9:42 AM
  • User546194788 posted

    Thank you for help but what I want is without any code to let user run queries and reports in Access.(just open it)

    Friday, February 18, 2011 10:16 AM
  • User-1199946673 posted

    When using and Access file in a web environment, you need to connect using Oledb. But be aware that at that moment, you're not dealing with Access, but with a Jet Database Engine. That means that you can only access the tables and query's in the file. You cannot access other objects like forms, reports and modules.. Also, in the query's you can only use functions that are supported by Jet. queries that use functions you made in modules will fail. That's the way it is. When you want to run queries, the easiest way is to use an SQLDatasource of AccessDataspource and bind that to a gridview

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, February 18, 2011 10:52 AM