1. criar o bd no sql server
2. colocar essa tabela no sqlserver
3. da uma olha nesta funçao
***************************
Function chamadaaosql(sqlcomando, sqlcursor)
STORE SQLSTRINGCONNECT('DRIVER='+m_driver+';SERVER='+m_servidor+';DATABASE='+;
m_bancoremo+';UID='+m_usuario+';PWD='+m_senha)TO TratadorConexao
if TratadorConexao < 0
*Erro de conexao ao banco de dados
=messagebox('Não foi possível gravar informações',16,'ERRO DE CONEXÃO AO BANCO DE DADOS')
sqlresp=.F.
else
=SQLSETPROP(TratadorConexao, 'asynchronous', .F.)
*Verifica informações do colaborador
sqlresp=0
sqlresp=SQLEXEC(TratadorConexao, sqlcomando, sqlcursor)
transacao OK
= SQLEXEC(TratadorConexao,;
'select @@ERROR as sucesso','cur_atualiza')
if cur_atualiza.sucesso=0
= SQLEXEC(TratadorConexao,;
'COMMIT TRAN','')
else
= SQLEXEC(TratadorConexao,;
'ROLLBACK TRAN','')
select cur_atualiza
=messagebox('Não foi possível gravar informações ERRO Nº '+ str (cur_atualiza.sucesso,5),16,'ERRO NO BANCO DE DADOS')
Endif
=SQLCOMMIT(TratadorConexao)
=SQLDISCONNECT(TratadorConexao)
ENDIF
Return sqlresp
Previous
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only