PC SOFT

FOROS PROFESIONALES
WINDEVWEBDEV y WINDEV Mobile

Inicio → WINDEV 2024 → WD22 SQLinfo() not working.
WD22 SQLinfo() not working.
Iniciado por rob, 01,may. 2018 17:16 - 1 respuesta
Miembro registrado
105 mensajes
Publicado el 01,mayo 2018 - 17:16
I can't explain this. If anyone has any clue why this stopped working, I'd be extremely grateful.

I have some code using SQLConnect() to connect to an SQL server. And a little bit ago, calling SQLinfo() in the event of an error was populating the error variables. But that is no longer happening for some reason.

It's just a little function that connects to an SQL server to verify the entered credentials are good, and saves that instance name to a file.
But now I'm getting a debug screen stating:
Error at line 22 of Click BTN_OK process.
SQLInfo function called.
No current connection.

It works perfectly fine when debugging the procedure in windev, but upon compiling, it breaks.

nConnectionID is int
IF EDT_Username = "" THEN
nConnectionID = SQLConnect(EDT_Instance,"", "", "master", "OLEDB" ,hOledbSQLServer, "Trusted_Connection=YES")
ELSE
nConnectionID = SQLConnect(EDT_Instance, EDT_Username, EDT_Password, "master", "OLEDB" ,hOledbSQLServer)
END

//Info(nConnectionID)

IF nConnectionID <> 0 THEN
HOpen(SQLInstance)
ScreenToFile(WIN_New_Instance)
IF nRecordID = -1 THEN
HAdd(SQLInstance)
ELSE
HModify(SQLInstance)
END
HClose(SQLInstance)
Close(WIN_New_Instance)
ELSE
SQLInfo()
Error("The connection to the data source " + EDT_Instance + " failed." + CR + ...
"Error code: " + SQL.Error + CR + SQL.MesError)
END
SQLDisconnect()
Miembro registrado
105 mensajes
Publicado el 01,mayo 2018 - 17:56
So apparently this was caused by changing the framework setting when compiling the application.
It can't be set to where the dll files are integrated into the exe.