|
-
Jun 28th, 2010, 11:50 PM
#1
Thread Starter
New Member
Execute a tsql statement from VB6
Hi,
I am a .net developer.I would like to know the code to execute an sql statement which looks like exec msdb.dbo.sp_start_job @job_name = 'test' from vb6.
Thanks,
Adityaraj.
-
Jun 29th, 2010, 01:07 AM
#2
Re: Execute a tsql statement from VB6
Hi aditya... Welcome to the forums...
Check this tutorial: http://www.vbforums.com/showthread.php?t=381391
If my post was helpful to you, then express your gratitude using Rate this Post. 
And if your problem is SOLVED, then please Mark the Thread as RESOLVED (see it in action - video)
My system: AMD FX 6100, Gigabyte Motherboard, 8 GB Crossair Vengance, Cooler Master 450W Thunder PSU, 1.4 TB HDD, 18.5" TFT(Wide), Antec V1 Cabinet
Social Group: VBForums - Developers from India
Skills: PHP, MySQL, jQuery, VB.Net, Photoshop, CodeIgniter, Bootstrap,...
-
Jun 29th, 2010, 08:01 AM
#3
Re: Execute a tsql statement from VB6
Thread moved to 'Database Development' forum (the 'VB6' forum is only meant for questions which don't fit in more specific forums)
I would actually recommend the "ADO Tutorial" from the "Classic VB" section of our Database Development FAQs/Tutorials (at the top of this forum).
All you need for this is the Connection object, and then you can use code like this:
Code:
cn.Execute "exec msdb.dbo.sp_start_job @job_name = 'test'"
However, it would also be apt (and better for various reasons) to use a Command object to run it, and there is another FAQ article which covers that.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|