problem with function

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
 
S

Sergey Poberezovskiy

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)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top