problem with function

  • Thread starter Thread starter alecarnero
  • Start date Start date
A

alecarnero

MY PROBLEM IS THE NEXT : I HAVE A FUNCTION NAMED cpf_VALIDO, THIS FUNCTION
RECEIVE
A VARCHAR AND RETURNS A CHAR

CREATE FUNCTION CPF_VALIDO(@CPF VARCHAR(11))
RETURNS CHAR(1)

IN THE form i have write this

Dim controle As ADODB.Command


Set cn = CurrentProject.Connection
Set controle = New ADODB.Command
Set controle.ActiveConnection = cn
controle.CommandText = "cpf_valido"
controle.CommandType = adCmdStoredProc
controle.CommandTimeout = 15
controle.Parameters("@cpf") = 25509006856#
controle.Execute

what i need to write to obtain the return char(1)

Thanks in advance Alejandro Carnero
 
change CommandText to "select * from cpf_valido"
and then capture the output:

Dim rs As ADODB.Recordset
Set rs = controle.Execute

If Not rs.EOF Then Debug.Print rs(0)
 
Back
Top