locked
Could not find stored procedure 'False' RRS feed

  • Question

  • I am having an error "Could not find stored procedure 'False' " each time I click on the button code below. Do anyone know why

    Code Snippet
    Private Sub BACK_UP_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BACK_UP.Click
       

    cmd = New SqlCommand("Backup database" & Me.cbdatabase.Text & "to disk" = "'C:\Documents and Settings\My Documents\PERSONAL DOCUMENTS\filename.bak'", conn)
            conn.Open()
            cmd.ExecuteNonQuery()
            conn.Close()

    End Sub


    Thursday, May 8, 2008 7:40 AM

Answers

  • Dear   Larry King

     

    The query you have written is wrong. The query should look like:

    BACKUP DATABASE AdventureWorks
    TO DISK = 'C:\MSSQL\BACKUP\AdventureWorks.Bak'

    Try this:

    cmd = New SqlCommand("BACKUP DATABASE" & Me.cbdatabase.Text & "TO DISK = ':\Documents and Settings\My Documents\PERSONAL DOCUMENTS\filename.bak' ", conn);

     

    Hope this helps you!!!

     

     

     

    Thursday, May 8, 2008 11:57 AM
  • Dear   Larry King,

     

    This problem has occurred because you dont have required permission on the database. Here you means the user that is used in the connection string to connect to the database. Give the appropriate permissions and it will work fine Smile

     

    One suggestion: Always mark usefull posts as Answers+Helpfull, since this may help other people, who face same problem.

    Friday, May 9, 2008 7:41 AM

All replies

  • Dear   Larry King

     

    The query you have written is wrong. The query should look like:

    BACKUP DATABASE AdventureWorks
    TO DISK = 'C:\MSSQL\BACKUP\AdventureWorks.Bak'

    Try this:

    cmd = New SqlCommand("BACKUP DATABASE" & Me.cbdatabase.Text & "TO DISK = ':\Documents and Settings\My Documents\PERSONAL DOCUMENTS\filename.bak' ", conn);

     

    Hope this helps you!!!

     

     

     

    Thursday, May 8, 2008 11:57 AM
  • Thank you Sandeep that seem to work except that I have a new problem:

    Database 'MyDatabase' cannot be opened due to inaccessible files or insufficient memory or disk space.  See the SQL Server errorlog for details. BACKUP DATABASE is terminating abnormally. Do anyone know how I can resolve the problem from my VB 2005 Express?
    Thursday, May 8, 2008 5:46 PM
  • Dear   Larry King,

     

    This problem has occurred because you dont have required permission on the database. Here you means the user that is used in the connection string to connect to the database. Give the appropriate permissions and it will work fine Smile

     

    One suggestion: Always mark usefull posts as Answers+Helpfull, since this may help other people, who face same problem.

    Friday, May 9, 2008 7:41 AM