PC SOFT

GRUPOS DE DISCUSSÃO PROFISSIONAL
WINDEVWEBDEV e WINDEV Mobile

Inicio → WINDEV 2024 → Generate Project using SQL Server Native Driver Do not Open a connection, but in Debug works Fine
Generate Project using SQL Server Native Driver Do not Open a connection, but in Debug works Fine
Iniciado por Carlos, nov., 28 2019 2:23 PM - 1 resposta
Membro registado
8 mensagems
Publicado em novembro, 28 2019 - 2:23 PM
Hi have Project working fine in Windev vrs 20 using SQl server native Driver
now we Update all the project to version 23 .

Hi this simple project is a piece of the main project just to test connection
has no Analisys, nothing, only a Main Forms to do a conecction and show if this OK
So Running in developer Mode or Debug mode works fines
so the connection is done, the database is ok the server is on line (is this test i am using a local database)

But when I generate the .EXE from this project and run the connection FAILS

Does any body here can help me?

Tks
Carlos Lages
Dec


GLOBAL

gsUsuario is ANSI string
gsNome is ANSI string
gsSenha is ANSI string

gsGrupo is string
gsItem is string
gsSubitem is string

gsPrograma is ANSI string
gnSAtalho is int

gnQtConexoes is int
gsBancodeDados is string
gsServidor is string

Wsge_Empresa is int // sera passado para todos os programas o codigo da Empresa
Wsge_NomeEmpresa is string // sera passado para todos os programas o Nome da Empresa


EXTERN "KeyConst.WL" // para controlar as teclas de funcoes
EXTERN "WinConst.WL"


HDescribeConnection("Dec","sa","teste","DEC-PC","teste",hNativeAccessSQLServer,hOReadWrite,"Server Port = 1433")


// Opening the connxection
IF HOpenConnection("Dec") = False THEN
Error("The connection to the data source " + " failed." + CR + "Error code: " + SQL.Error + CR + SQL.MesError)
RETURN
END


sSql is ANSI string
bExecuta is boolean

//// Pega Nome do Servidor e Nome do Banco de Dados
MyProcedure is Data Source

MyProcedure.Database = " "
MyProcedure.servername = " "
IF not HExecuteSQLQuery(MyProcedure, "Dec", hQueryWithoutCorrection, "Dec_Getserver @Database out ,@servername out" ) THEN
//IF NOT HExecuteSQLQuery(MyProcedure, "AcessoNativoSQL", hQueryWithoutCorrection, "Dec_Getserver @Database out ,@servername out" ) THEN
Error(HErrorInfo())
Close()
ELSE
gsServidor = MyProcedure.servername
gsBancodeDados = MyProcedure.Database
END
HCancelDeclaration(MyProcedure) // libera da memoria

Info(gsServidor,gsBancodeDados)
Membro registado
8 mensagems
Publicado em novembro, 29 2019 - 12:31 PM
Hi i found by my self and friends help how to solve it
we must create a install of project, so this works fine
only using Button GENERATE , do not work

att
carlos Lages