Welcome to SPN

Register and Join the most happening forum of Sikh community & intellectuals from around the world.

Sign Up Now!

Running an Access97 Query From VS.NET C# Windows App

Discussion in 'Information Technology' started by Frank, Jul 28, 2006.

  1. Frank

    Frank
    Expand Collapse
    Guest

    A few days ago I posted a question where I asked about how I could call/run
    a query in an Access97 db from a Wndows Application I am writing with VS.Net
    2003 in C#.



    I had a couple of replies and good suggestions but none fully helped me get
    the thing in gear because I guess I am too inexperienced in this area to
    fully understand how to implement their suggestions.



    Then I found an article entitled 'How to automate Microsoft Access by using
    Visual C#' at



    http://www.dotnet247.com/247reference/a.aspx?u=http://support.microsoft.com/?kbid=317114



    which helped me accomplish my task with some minor code modification (I
    changed the 'Print_Report()' function to execute the query I need to run
    using oAccess.DoCmd.OpenQuery(.). It does work but I am wondering about one
    of the responses I got a few days ago where someone suggested I try



    currentdb.execute "NameOfYourQuery"



    Does anyone know how to use this code.could you provide a sample? I ask
    because the code I am using from the link above is pretty long and probably
    does a lot of stuff that creates quite a bit of overhead.



    Thanks in advance
     
  2. Loading...


  3. Douglas J Steele

    Douglas J Steele
    Expand Collapse
    Guest

    CurrentDb.Execute "NameOfYourQuery" will only work for Action queries
    (Insert Into, Update, Delete). It will do nothing for Select queries.

    --
    Doug Steele, Microsoft Access MVP
    http://I.Am/DougSteele
    (no e-mails, please!)


    "Frank" <fkaesser@pfmail.com> wrote in message
    news:eNXMr5yiGHA.1640@TK2MSFTNGP02.phx.gbl...
    > A few days ago I posted a question where I asked about how I could

    call/run
    > a query in an Access97 db from a Wndows Application I am writing with

    VS.Net
    > 2003 in C#.
    >
    >
    >
    > I had a couple of replies and good suggestions but none fully helped me

    get
    > the thing in gear because I guess I am too inexperienced in this area to
    > fully understand how to implement their suggestions.
    >
    >
    >
    > Then I found an article entitled 'How to automate Microsoft Access by

    using
    > Visual C#' at
    >
    >
    >
    >

    http://www.dotnet247.com/247reference/a.aspx?u=http://support.microsoft.com/?kbid=317114
    >
    >
    >
    > which helped me accomplish my task with some minor code modification (I
    > changed the 'Print_Report()' function to execute the query I need to run
    > using oAccess.DoCmd.OpenQuery(.). It does work but I am wondering about

    one
    > of the responses I got a few days ago where someone suggested I try
    >
    >
    >
    > currentdb.execute "NameOfYourQuery"
    >
    >
    >
    > Does anyone know how to use this code.could you provide a sample? I ask
    > because the code I am using from the link above is pretty long and

    probably
    > does a lot of stuff that creates quite a bit of overhead.
    >
    >
    >
    > Thanks in advance
    >
    >
     
  4. david epsom dot com dot au

    david epsom dot com dot au
    Expand Collapse
    Guest

    We make a distinction between 'running' a query and
    'displaying' a query. To display data in C# you might
    use a form. To make changes to data in a database you
    might use ADO.net.

    > currentdb.execute "NameOfYourQuery"



    Well, you aren't the only person here who is not experienced.
    That is how you would make changes to data if you were using
    Microsoft Office Pro instead of C#.

    (david)

    "Frank" <fkaesser@pfmail.com> wrote in message
    news:eNXMr5yiGHA.1640@TK2MSFTNGP02.phx.gbl...
    >A few days ago I posted a question where I asked about how I could call/run
    >a query in an Access97 db from a Wndows Application I am writing with
    >VS.Net 2003 in C#.
    >
    >
    >
    > I had a couple of replies and good suggestions but none fully helped me
    > get the thing in gear because I guess I am too inexperienced in this area
    > to fully understand how to implement their suggestions.
    >
    >
    >
    > Then I found an article entitled 'How to automate Microsoft Access by
    > using Visual C#' at
    >
    >
    >
    > http://www.dotnet247.com/247reference/a.aspx?u=http://support.microsoft.com/?kbid=317114
    >
    >
    >
    > which helped me accomplish my task with some minor code modification (I
    > changed the 'Print_Report()' function to execute the query I need to run
    > using oAccess.DoCmd.OpenQuery(.). It does work but I am wondering about
    > one of the responses I got a few days ago where someone suggested I try
    >
    >
    >
    > currentdb.execute "NameOfYourQuery"
    >
    >
    >
    > Does anyone know how to use this code.could you provide a sample? I ask
    > because the code I am using from the link above is pretty long and
    > probably does a lot of stuff that creates quite a bit of overhead.
    >
    >
    >
    > Thanks in advance
    >
     

Share This Page