GRUPOS DE DISCUSSÃO PROFISSIONAL
WINDEV
,
WEBDEV
e
WINDEV Mobile
Inicio
|
Mensagens recentes
|
Conecte-se...
|
Disconnect
|
Português
Inicio
→
WINDEV 2024
→
check Microsoft SQL connection
check Microsoft SQL connection
Iniciado por Andrea Fortune, fev., 24 2019 9:29 AM - 1 resposta
Conecte-se…
Andrea Fortune
#1
Publicado em fevereiro, 24 2019 - 9:29 AM
Hello,
I'm working with an external Ms SQL server in LAN network via OLEDB connection.
The configuration works good and I'm able to read that database using queries with windev.
The problem is when the server is shut down, if the client execute a query windev crash's.
I want to avoid this, checking if the connection is working it can execute the query.
I need
1) something to check Hconnection status (I want to use a green icon if the connection is established)
2) something to use set a timeout (I tried to use something in the guide but I doesn't work)
Thanks
Denunciar
0
0
Tassilo
#2
Publicado em março, 09 2019 - 3:49 PM
Hi,
I always check the connection status with a procedure:
Procedure
GetConnectiontoSql
(
)
n
Conn
is boolean
n
Conn
=
SQLConnect
(
gsserver
,
""
,
""
,
gsdb
,
"OLEDB"
,
"SQLOLEDB"
,
"Trusted_Connection=YES"
)
IF
n
Conn
=
False
THEN
SQLInfo
(
)
Error
(
"The connection to the data source "
+
gsdb
+
" failed."
+
CR
+
"Error code: "
+
SQL.Error
)
END
RESULT
n
Conn
Now you can set an icon.
Denunciar
0
0
→ Voltar para WINDEV 2024
WINDEV 2024
WEBDEV 2024
WINDEV Mobile 2024
WINDEV (versões anteriores)
Français
English
Español
Portuguesa
Fermer cette fenêtre
Tipo de Pesquisa
Apenas tópicos
Todas as mensagens
Período de pesquisa
Qualquer momento
Última hora
Últimas 24 horas
Semana passada
Mês passado
Ano passado
Cancelar
Pré-visualização da sua mensagem
Adicionar imagem
Importar uma imagem de uma URL
Enviar uma imagem a partir do seu disco
Deixe um ficheiro ou clique em "Procurar ..."
ou
Cancelar
0%
WLanguage
SQL
XML, HTML
JAVA, Javascript
Texto