469,636 Members | 1,948 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,636 developers. It's quick & easy.

stop/start sql server 2000 using vb6

284 100+
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
Mar 23 '08 #1
3 3027
jg007
283 100+
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.computerperformance.co.uk/vbscript/wmi_services.htm#Example_2_-_Script_to_Stop,_then_Start_a_Windows_Service_
Mar 23 '08 #2
muddasirmunir
284 100+
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.computerperformance.co.uk/vbscript/wmi_services.htm#Example_2_-_Script_to_Stop,_then_Start_a_Windows_Service_[/quote]
Mar 23 '08 #3
jg007
283 100+
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
Mar 23 '08 #4

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

3 posts views Thread by tombat | last post: by
5 posts views Thread by Paul O. Morris | last post: by
16 posts views Thread by Serdar Kalaycý | last post: by
reply views Thread by gheharukoh7 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.