Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsVB SyntaxEnterprise DevelopmentDatabase AccessControlsCOMWin APICrystal ReportDeploymentGeneralGeneral 2
Related Topics
VB.NET / ASP.NETMS SQL ServerMS AccessOther Database ProductsMore Topics ...

VB Forum / General / November 2004



Tip: Looking for answers? Try searching our database.

VB6 Run As a Service

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
DavidM - 30 Nov 2004 03:37 GMT
I would like to write a VB6 program that I can run as a service.

Basically, the service will scan a directory for file(s).

Once a file is found, it will INSERT the file into a SQL Server database.

It will then copy the file to an alternate location to be processed.

It will then delete the original file.

Anyone have any sample code for this?

Would I be better off learning VB.Net and writing program as a service?

What is the best way to monitor a directory for new files?  I hear there is
something called ChangeNotify or something.  Is this what I want?
Paul Clement - 30 Nov 2004 15:00 GMT
¤ I would like to write a VB6 program that I can run as a service.
¤
¤ Basically, the service will scan a directory for file(s).
¤
¤ Once a file is found, it will INSERT the file into a SQL Server database.
¤
¤ It will then copy the file to an alternate location to be processed.
¤
¤ It will then delete the original file.
¤
¤ Anyone have any sample code for this?
¤
¤ Would I be better off learning VB.Net and writing program as a service?
¤

Yes. First, you can easily develop a Windows service in VB.NET without the restrictions and
workarounds with respect to VB 6.0. A project template is included for .NET.

In addition, .NET has a FileSystemWatcher class that should accomplish exactly what you are
attempting to do.

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlr
fsystemiofilesystemwatcherclasstopic.asp


Paul ~~~ pclement@ameritech.net
Microsoft MVP (Visual Basic)
Ken Halter - 30 Nov 2004 15:46 GMT
>I would like to write a VB6 program that I can run as a service.
>
[quoted text clipped - 7 lines]
>
> Anyone have any sample code for this?

Subject: Build an NT Service in Visual Basic 6???
http://groups.google.com/groups?hl=en&lr=&th=50a99fbf4e713b9&rnum=1

More where that came from
Results 1 - 100 of about 250 for "create a service" -dotnet group:*.vb.*.
(5.98 seconds)
http://groups.google.com/groups?as_epq=create%20a%20service&as_eq=dotnet&safe=im
ages&as_ugroup=*.vb.*&as_scoring=d&lr=&num=100&hl=en


> Would I be better off learning VB.Net and writing program as a service?
>
> What is the best way to monitor a directory for new files?  I hear there
> is something called ChangeNotify or something.  Is this what I want?

Creating a Watched Folder with FindChangeNotification
http://vbnet.mvps.org/index.html?code/fileapi/watchedfolder.htm

Signature

Ken Halter - MS-MVP-VB - http://www.vbsight.com
Please keep all discussions in the groups..

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.