Sem analizar os parâmetros que usas, mas apenas verificando o fluxo de tuas conexões, fiz uma observação que deve te ajudar.
sem mais,
Alexandre Herculano
(Emprel - Recife)
DIALOGBOX LOGINA
Call
SalWaitCursor( TRUE )
Set
sUsername = dfUserName
Set
sPassword = SalStrUpperX(dfPassword)
Set
SqlUser = dfUserName
Set
SqlPassword = dfPassword
Set
SqlDatabase = 'WINSISAB'
Set
bConectado = SqlConnect(hSql)
If
NOT bConectado
Call SalWaitCursor(FALSE)
Return
FALSE
<=========== Não fará as conexões
abaixo e, se a conexão hSql tiver
Set
bConectado3 = SqlConnect(hSqlReport)
sucesso, retornará com o SalWaitCursor( TRUE
) e dá a
Set
bConectado2 = SqlConnect(hSql1)
impressão que está preso.
If
NOT bConectado OR
NOT bConectado2 OR
NOT bConectado3 OR
Call SalWaitCursor(FALSE)
Return
FALSE
Call SalEndDialog(dlgLogina, TRUE)
Antonio Baptista wrote:
Alo colegas
tenho a seguinte dúvida
Trabalho na versão 1.5 Centura e Motor de base de dados SQLBASE 7.0Acontece que a maior parte das vezes quando nos conectamos á base de dados e ao tentarmos ler determinada tabela
se esta estiver em uso por outro colega a aplicação bloqueia. Eu gostaria de saber se o código abaixo é o mais correcto
de ser usado.ON SAM_AppStartup
If SalModalDialog( dlgLogina, hWndNULL)
Call SalWaitCursor( TRUE )
Call SqlSetResultSet( hSql, TRUE )
Call SqlSetIsolationLevel( hSql, 'RL' )
Call SqlSetIsolationLevel( hSql1, 'RL' )
Call SqlSetParameter( hSql, 5,-1, '' )
Call SqlSetParameter( hSql1, 5,-1, '' )
Call SqlSetParameter( hSql1, DBP_AUTOCOMMIT, TRUE, '' )
Call SqlSetParameter( hSql, DBP_AUTOCOMMIT, TRUE, '' )
Call SqlSetParameter( hSql, DBP_PRESERVE, TRUE, '' )
Call SqlSetParameter( hSql1, DBP_PRESERVE, TRUE, '' )
Call SalWaitCursor( FALSE )
Call SalCreateWindow( mdiSismenu, hWndNULL ) (criação da primeira janela)
Call SalMapEnterToTab( TRUE )DIALOGBOX LOGINA
Call SalWaitCursor( TRUE )
Set sUsername = dfUserName
Set sPassword = SalStrUpperX(dfPassword)
Set SqlUser = dfUserName
Set SqlPassword = dfPassword
Set SqlDatabase = 'WINSISAB'
Set bConectado = SqlConnect(hSql)
If NOT bConectado
Call SalWaitCursor(FALSE)
Return FALSE
Set bConectado3 = SqlConnect(hSqlReport)
Set bConectado2 = SqlConnect(hSql1)
If NOT bConectado OR
NOT bConectado2 OR
NOT bConectado3 OR
Call SalWaitCursor(FALSE)
Return FALSE
Call SalEndDialog(dlgLogina, TRUE)
