Replace function in Access

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • seanmatthewwalsh@hotmail.com

    Replace function in Access

    Hi

    I have a website that uses an Access 2003 database. I have controls on
    my pages that are bound to SqlDataSources that pull data from this
    database. In a couple of them, I need to use the replace function to
    replace some text in the results. Access' REPLACE function is only
    available if executed within the environment, as it's a VBA function,
    not a SQL function. So how can I implement this is the EASIEST
    possible way? I don't to rewrite all my pages to first pull the data
    into a DataSet and then do the replace, as I'll soon be back on SQL
    Server, and can use the Replace function there.

    Can I either do some sort of post-result transformation on the page
    side, or how do I set up a macro / function in Access that the query
    will be able to see? I created a MYREPLACE function in a Module, which
    works fine if I run it in Access, but I still get the web error:
    System.Data.Ole Db.OleDbExcepti on: Undefined function 'MYREPLACE' in
    expression

    thanks
    Sean
  • Tom van Stiphout

    #2
    Re: Replace function in Access

    On Tue, 20 May 2008 02:09:32 -0700 (PDT), seanmatthewwals h@hotmail.com
    wrote:

    MYREPLACE is a Vba function just like REPLACE, and you already stated
    they cannot be used.
    You'll have to do this on the DotNet side, or postpone the work until
    you're back on SQL Server.

    -Tom.

    >Hi
    >
    >I have a website that uses an Access 2003 database. I have controls on
    >my pages that are bound to SqlDataSources that pull data from this
    >database. In a couple of them, I need to use the replace function to
    >replace some text in the results. Access' REPLACE function is only
    >available if executed within the environment, as it's a VBA function,
    >not a SQL function. So how can I implement this is the EASIEST
    >possible way? I don't to rewrite all my pages to first pull the data
    >into a DataSet and then do the replace, as I'll soon be back on SQL
    >Server, and can use the Replace function there.
    >
    >Can I either do some sort of post-result transformation on the page
    >side, or how do I set up a macro / function in Access that the query
    >will be able to see? I created a MYREPLACE function in a Module, which
    >works fine if I run it in Access, but I still get the web error:
    >System.Data.Ol eDb.OleDbExcept ion: Undefined function 'MYREPLACE' in
    >expression
    >
    >thanks
    >Sean

    Comment

    Working...