stop/start sql server 2000 using vb6

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • muddasirmunir
    Contributor
    • Jan 2007
    • 284

    stop/start sql server 2000 using vb6

    i am using sqlserver 2000 and vb6
    i am copying data files of the sqlserver and paste it on other location.
    and i am copying pasting it with the help of coding
    coding works fine

    but i am facing problem that before copying i had to manually stop
    the sqlserver service and after copying i manually start sqlserver if i did not stop service its give me errror
    "Access denied"

    i want to do it with the help of coding so before start copying it stop servcie
    and after copyting it autoamically start service.
    so what is the code to stop/start sqlserver 2000
  • jg007
    Contributor
    • Mar 2008
    • 283

    #2
    Originally posted by muddasirmunir
    i am using sqlserver 2000 and vb6
    i am copying data files of the sqlserver and paste it on other location.
    and i am copying pasting it with the help of coding
    coding works fine

    but i am facing problem that before copying i had to manually stop
    the sqlserver service and after copying i manually start sqlserver if i did not stop service its give me errror
    "Access denied"

    i want to do it with the help of coding so before start copying it stop servcie
    and after copyting it autoamically start service.
    so what is the code to stop/start sqlserver 2000
    not to sure on the VB code but would VB script not do what you want?

    see below for some example script

    http://www.computerper formance.co.uk/vbscript/wmi_services.ht m#Example_2_-_Script_to_Stop ,_then_Start_a_ Windows_Service _

    Comment

    • muddasirmunir
      Contributor
      • Jan 2007
      • 284

      #3
      what is the difference between VB and VB Script i donot know
      well i am using vb6







      QUOTE=jg007]not to sure on the VB code but would VB script not do what you want?

      see below for some example script

      http://www.computerper formance.co.uk/vbscript/wmi_services.ht m#Example_2_-_Script_to_Stop ,_then_Start_a_ Windows_Service _[/QUOTE]

      Comment

      • jg007
        Contributor
        • Mar 2008
        • 283

        #4
        vbscripts are text files ending with a .VBS extension that do not need to be compiled and are run by clicking on them or from the command line.

        apologies I didn't fully read your post and was thinking that for the one thing , stopping services VBS would be easier but if you already have vb code to move some files then that might not be relevant :)

        it should be fairly easy to code just not something I have tried to do but if I get a chance I will try to work it out if nobody else posts

        Comment

        Working...