Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ' * Desenvolvido por Antonio Carlos
- ' * Data: 18/06/2011
- ' * Hora: 11:38
- ' * Classe de Conexao com Banco de Dados
- ' * FireBird
- #Region "Importação de Name Spaces"
- imports System
- imports System.Data
- imports System.Windows.Forms
- imports FirebirdSql.Data.FirebirdClient
- #End Region
- Class bdComn
- Function abrirbanco() As FbConnection
- Dim strconexao as String = "User=SYSDBA;Password=masterkey;Database=data_base.fdb;DataSource=localhost; Port=3050;Dialect=3; Charset=NONE;Role=;Connection lifetime=15;Pooling=true; MinPoolSize=0;MaxPoolSize=50;Packet Size=8192;ServerType=0;"
- Dim cn As FbConnection = New FbConnection(strconexao)
- Try
- cn.open()
- if cn.State=ConnectionState.Open then
- messagebox.Show("Conexão foi aberta com sucesso !!!","Sistema Emissor")
- End If
- Return cn
- Catch e As System.Exception
- Throw e
- End Try
- End Function
- '--------------------------------------------------------------------------
- Public Sub fecharbanco(cn As FbConnection )
- If cn.State = ConnectionState.Open Then
- cn.Close()
- End If
- End Sub
- End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement