N
NiteFly
Hello
i've read all the threads dealing with the subject.
I've written my wrapper to the native replace function.it works fine
inside access.
i've changed sandbox value to 0.
but the problem still persists.
in addiction now there is no REPLACE function, but MyReplace.
this is the access code
Option Compare Database
Public Function MyReplace(StringToSearchIn As String, _
StringToFind As String, _
ReplaceString As String, _
Optional StartHere As Integer = 1, _
Optional HowMany As Integer = -1, _
Optional CompareMode As VbCompareMethod = vbTextCompare) As String
MyReplace = Replace(StringToSearchIn, StringToFind, ReplaceString,
StartHere, HowMany, CompareMode)
End Function
Public Function DoNot() As Integer
DoNot = 1
End Function
this is my vb6 code
Dim aCnn As New ADODB.Connection
Dim aRst As New ADODB.Recordset
Dim SQL As String
Dim dq As String
Dim sa As String
Dim Filtro As String
Dim RepFiltro As String
dq = Chr(34)
sa = Chr(39)
Filtro = dq & sa & dq
RepFiltro = dq & dq
On Error GoTo 0
aCnn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\Sorgenti
\_Mei\Eco.mdb;Persist Security Info=False"
SQL = "Select * from Tab_Pazienti where MyReplace(Nome, " & Filtro
& "," & RepFiltro & ")=" & dq & "Massimo" & dq
aRst.Open SQL, aCnn, adOpenKeyset, adLockOptimistic, adCmdText
last statement raises error "undefined function MyReplace in
expression"
if i change last one with ' SQL = "Select donot()" ' i get
"undefined function donot in expression".
this is driving me crazy.
If i execute the SAME queries inside ACCESS all work fine.
where is my mistake ?
Please help me.
i've read all the threads dealing with the subject.
I've written my wrapper to the native replace function.it works fine
inside access.
i've changed sandbox value to 0.
but the problem still persists.
in addiction now there is no REPLACE function, but MyReplace.
this is the access code
Option Compare Database
Public Function MyReplace(StringToSearchIn As String, _
StringToFind As String, _
ReplaceString As String, _
Optional StartHere As Integer = 1, _
Optional HowMany As Integer = -1, _
Optional CompareMode As VbCompareMethod = vbTextCompare) As String
MyReplace = Replace(StringToSearchIn, StringToFind, ReplaceString,
StartHere, HowMany, CompareMode)
End Function
Public Function DoNot() As Integer
DoNot = 1
End Function
this is my vb6 code
Dim aCnn As New ADODB.Connection
Dim aRst As New ADODB.Recordset
Dim SQL As String
Dim dq As String
Dim sa As String
Dim Filtro As String
Dim RepFiltro As String
dq = Chr(34)
sa = Chr(39)
Filtro = dq & sa & dq
RepFiltro = dq & dq
On Error GoTo 0
aCnn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\Sorgenti
\_Mei\Eco.mdb;Persist Security Info=False"
SQL = "Select * from Tab_Pazienti where MyReplace(Nome, " & Filtro
& "," & RepFiltro & ")=" & dq & "Massimo" & dq
aRst.Open SQL, aCnn, adOpenKeyset, adLockOptimistic, adCmdText
last statement raises error "undefined function MyReplace in
expression"
if i change last one with ' SQL = "Select donot()" ' i get
"undefined function donot in expression".
this is driving me crazy.
If i execute the SAME queries inside ACCESS all work fine.
where is my mistake ?
Please help me.