Jump to content
Ana_Moreira

Backup SQL

Recommended Posts

Ana_Moreira

bom dia.. meus amigos..

preciso de uma ajuda..

tenho que fazer um programa em vb 6, que faça backup de base de dados sql..

mas não sei como fazer.. :s

o programa tem de dar para escolher as base de dados, que o mesmo procura logo que inicia, e depois tem de permitir escolher os dias da semana em que quer fazer backup, a que horas, e se quer guardar em zip e/ou em cd/dvd..

ajudem-me..

estou à uma semana à procura de codigo, e nada..


A'MoreiraEu sobrevivi ao fim do mundo (: ahahahhttp://lmgtfy.com/?q=digite+aqui+sua+duvida+que+eu+te+respondo!

Share this post


Link to post
Share on other sites
Ana_Moreira

bem, eu ja vi aquilo..

mas nao tenho o SQLDMO..

onde o posso arranjar?

mas nao sei como hei-de fazer para procurar no computador as base de dados! :S


A'MoreiraEu sobrevivi ao fim do mundo (: ahahahhttp://lmgtfy.com/?q=digite+aqui+sua+duvida+que+eu+te+respondo!

Share this post


Link to post
Share on other sites
Ana_Moreira

ja encontrei aqilo do sqldmo..

ja funciona..

sera que da para fazer uma lista numa datagrid ou num msflexgrid com as base de dados encontradas?

É que ja tentei trabalhar com elas, mas nao concigo.. sou eu que nao sei, ou nao da para o fazer?


A'MoreiraEu sobrevivi ao fim do mundo (: ahahahhttp://lmgtfy.com/?q=digite+aqui+sua+duvida+que+eu+te+respondo!

Share this post


Link to post
Share on other sites
Ana_Moreira

alguem me pode ajudar a "traduzir" de vb2008 para vb6?

Imports System.Data.Common.ConnectionStringDialog

Public Class MainForm
    Private xCustomControl As ConnectionEditorBase
    Private Sub MainForm_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        LoadConnectionTypes()
    End Sub

    Private Sub LoadConnectionTypes()
        Dim dtCnnTypes As New DataTable
        dtCnnTypes.Columns.Add(New DataColumn("Name", GetType(String)))
        dtCnnTypes.Columns.Add(New DataColumn("Value", GetType(Integer)))

        'Load all enum connection types exept for custom (-1)
        Dim values As Integer() = [Enum].GetValues(GetType(ConnectionType))
        For Each xelem As Integer In values
            Dim row As DataRow = dtCnnTypes.NewRow
            If xelem <> -1 Then
                row("Name") = [Enum].GetName(GetType(ConnectionType), xelem)
                row("Value") = xelem
                dtCnnTypes.Rows.Add(row)
            End If
        Next

        'Add Custom Types
        Dim xrow As DataRow
        xrow = dtCnnTypes.NewRow
        xrow("Name") = "Firebird (Custom)"
        xrow("Value") = -1
        dtCnnTypes.Rows.Add(xrow)

        xrow = dtCnnTypes.NewRow
        xrow("Name") = "My SQL (Custom)"
        xrow("Value") = -1
        dtCnnTypes.Rows.Add(xrow)

        CnnTypeCombo.DisplayMember = "Name"
        CnnTypeCombo.ValueMember = "Value"
        CnnTypeCombo.DataSource = dtCnnTypes
    End Sub

    Private Sub BuildButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BuildButton.Click
        With dbdlg
            .Caption = "Connection String Editor"
            .ConnectionString = CnnStrTextBox.Text
            .ConnectionType = CnnTypeCombo.SelectedValue
            .AllowAdvancedProperties = AllowAdvPropsCheckBox.Checked
            .AllowTestConnection = AllowTestCheckBox.Checked
            .UsePreferedSize = UsePreferedSizeCheckBox.Checked
            .DialogStartPosition = FormStartPosition.CenterParent
            .CustomEditorControl = xCustomControl
            If .ShowDialog(Me) = Windows.Forms.DialogResult.OK Then
                CnnStrTextBox.Text = PrettyPrint(.ConnectionString)
            End If
        End With
    End Sub

    Private Sub ClearButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ClearButton.Click
        CnnStrTextBox.Text = ""
    End Sub
    Private Function PrettyPrint(ByVal sConnectionString As String) As String
        Return sConnectionString.Replace(";", ";" & vbCrLf)
    End Function

    Private Sub CnnTypeCombo_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CnnTypeCombo.SelectedIndexChanged
        CnnStrTextBox.Text = ""
        Select Case CnnTypeCombo.SelectedValue
            Case -1
                Select Case CnnTypeCombo.Text
                    Case "Firebird (Custom)"
                        xCustomControl = New FireBirdCnnStrEditor
                    Case "My SQL (Custom)"
                        xCustomControl = New MySQLCnnStrEditor
                End Select
            Case Else
                xCustomControl = Nothing
        End Select
    End Sub

    Private Sub UsePreferedSizeCheckBox_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles UsePreferedSizeCheckBox.CheckedChanged

    End Sub
End Class

obrigado


A'MoreiraEu sobrevivi ao fim do mundo (: ahahahhttp://lmgtfy.com/?q=digite+aqui+sua+duvida+que+eu+te+respondo!

Share this post


Link to post
Share on other sites
Ana_Moreira

onde concigo arranjar microsoft activeX data objects 2.5 library para visual basic 6.0?

nao encontro na net..

ajudem-me por favor


A'MoreiraEu sobrevivi ao fim do mundo (: ahahahhttp://lmgtfy.com/?q=digite+aqui+sua+duvida+que+eu+te+respondo!

Share this post


Link to post
Share on other sites
Ana_Moreira

alguem arranja um pack com conponentes do visual basic 6?


A'MoreiraEu sobrevivi ao fim do mundo (: ahahahhttp://lmgtfy.com/?q=digite+aqui+sua+duvida+que+eu+te+respondo!

Share this post


Link to post
Share on other sites
jpaulino

Cria outro tópico com um titulo sugestivo ... assim todos pensam que estás a falar de backups do SQL

Share this post


Link to post
Share on other sites
Ana_Moreira

ok obrigado (:


A'MoreiraEu sobrevivi ao fim do mundo (: ahahahhttp://lmgtfy.com/?q=digite+aqui+sua+duvida+que+eu+te+respondo!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...

Important Information

By using this site you accept our Terms of Use and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.