locked
Access Query to VS 2008 Query RRS feed

  • Question

  • User-2110109421 posted

    Is ther anyway i can change a Microsoft Access query to a query in VS 2008. Innocent

    Thanks

    Friday, November 25, 2011 7:16 AM

Answers

  • User-1199946673 posted

    It would make my life easier if their is some way to import the queries into VS rather than recreating every single one.

    What do you mean? If you've queries stored in the Access database, you can execute them just like a SQL Server Stored Procedure. Set the CommandText Property to the name of the query, and the CommandType Property to StoredProcedure.

    The only problem can be when you're using a function that isn't supported in OleDb of when using the like operator, as explained in my previous reply, since you want to support the Access Front end as wel. In that case, you need to create a query for teh Access Front end, as wel for the ASP.NET frontend

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, November 28, 2011 4:47 AM

All replies

  • User-744022866 posted

    If you are working against access database in VS 2008, then it will be ok, if you are using SQL server, then you might need to rewrite the query to comply with SQL. Any how it depends on the query you are using

    Friday, November 25, 2011 2:45 PM
  • User-1199946673 posted

    Is ther anyway i can change a Microsoft Access query to a query in VS 2008

    You need to explain what exactly you wan't to do? When you want to connect to an Access Database, an .mdb (access 2003 and lower) or .accdb (Access 2007 and higher), you need to use OleDb.

    http://www.mikesdotnetting.com/Article/78/AccessDataSource-SqlDataSource-and-connecting-to-Access-databases-in-ASP.NET

    When using OleDb, you need to realize that you can only access the tables and queries in the database file. Other objects are not available. That also means that you cannot use all functions that are available in Access. For example, the Replace function isn't available. And when using the Like parameter, the wilcard character is %, in Access it is *. But most queries will work just like in Access....

    Friday, November 25, 2011 8:18 PM
  • User-2110109421 posted

    Currently we are using a front end in Microsoft Access and a SQL Back End, we are recreating the Front End in Visual Studio 2008, Parts of it in ASP.NET to move certain users to access the New System via the Web, It would make my life easier if their is some way to import the queries into VS rather than recreating every single one.

    Thanks

    Monday, November 28, 2011 4:30 AM
  • User-1199946673 posted

    It would make my life easier if their is some way to import the queries into VS rather than recreating every single one.

    What do you mean? If you've queries stored in the Access database, you can execute them just like a SQL Server Stored Procedure. Set the CommandText Property to the name of the query, and the CommandType Property to StoredProcedure.

    The only problem can be when you're using a function that isn't supported in OleDb of when using the like operator, as explained in my previous reply, since you want to support the Access Front end as wel. In that case, you need to create a query for teh Access Front end, as wel for the ASP.NET frontend

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, November 28, 2011 4:47 AM