|
-
Aug 13th, 2003, 04:13 AM
#1
Thread Starter
Junior Member
Calling a stored function
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?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|