Hi,

Because the VBA function replace isn't accessible with the ole db Jet Provider in vb.net, I've made a module in my (Acces)database wich contains a function that returns the same value as replace does:

Function gReplace(strIn As String, strFind As String, strReplace As String) As String
gReplace = Replace(strIn, strFind, strReplace)
End Function

Now I would like to call this function in an updatequery from vb.net looking like this:

adapter.UpdateCommand.CommandText="UPDATE Crawford_nl
SET Phonenr= gReplace(Phonenr, '/', '')"

But when I execute the command I get the error: "Undefined function gReplace in expression".

And when I add this code:

adapter.UpdateCommand.CommandType=CommandType.StoredProcedure

I get the error: "Expected query name after EXECUTE"

Can anyone help me with this problem?