Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
 
  HOME    TRACKER    Visual Basic




Running MySql Connection As A Windows Service


I have been given an exercise to design a simple form in which the user enter 2 SQL queries. The queries are executed displaying the results and time it took to execute. This would be fairly simple apart from the fact that the DB connection and execution time need to be run as a windows service.

I have no idea where to start when it comes to windows services. Can anybody point me in the right direction




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
How To Tell Difference Between UserName/Password Error And MySQL Service Not Running?
Hi,

I've written an App in VB6 that connects to MySQL 4.0.18 on NT4, using MySQL Connect/ODBC 3.51. The logon screen asks the User to enter their UserName and Password. The problem is, when trying to error trap, the message that gets returned in NT for the MySQL Service not running is the same as the message for an Invalid UserName/Password combination, this error message is -2147467259

Has anyone come across a way around this?

Windows Service Running
How can I verify if a Windows Service such as Telnet is up and running on a remote server using a VB Script?

Getting Windows User While Running App As Service
Hi,

I have always been able to get the current Windows XP user using API. But now I have changed my app to run as a system service and it always returns SYSTEM as the current user. Does anyone know how to get the current user logged on even with my app as a system service? Does it write to the registry the current user logged on so i can just read that possibly?

Thanks!

Can I Check Does The Service Running On Windows?
Hi All,
Does any API or method can I use to check is there any service currently running in service named "xxx"(Service name).

Thanks
Samuel

Winsock Running From Windows Service Problem
Hi all,

I am writting some VB6 code using winsock to connect to an external ip address. The code works fine when I run it from VB or as an EXE. But when I install it and run as a service on Windows 2000 it errors with '10049 : Address is not available from the local machine'

I am using the svcit.ocx to make my vb code a windows service.

Please help!

Thanks in advance.

10Leo

VB6 Service Running On Windows 2000, Icon In Tray
I have VB6 program running as a Service on Windows 2000, I also have a Icon in the System Tray... If I log off, the service craps out with an error, which is not a real problem, because it is just set to restart itself after a minute. (I'll look into the crashing later)..

If I log back in, how can I have the service put the Icon back into the System Tray?

VB6 Program Running As Windows Service Interfering With MS Office
Hi there,

I have written a program which uses NTSVC.ocx to run the program as a service. My program simply checks a folder every x seconds to see if a new input file has arrived, processed this file and from that file determines which rule set is required, which is then read from an excel file.

The input data and the rules are then passed to a C++ dll which attempts to find a solution and then returns the solution, if found.

When I install the program as a service and run it, all is well. But when the program finds a file to process, the windows office installer activates. A user has a slightly different problem in that when the service is running they can't open an Excel file from Windows Explorer, but they can by opening Excel and then using File > Open.

Has anyone seen a problem like this before? I have just tried removing the MS Excel reference from the project and the interference no longer appears to occur. Is there a way to prevent this?

File Read Code Not Working While Running As Windows Service.. Pls Help Me Out
Hi , please help. I have done a small application to read a xml file and copy the requirement contents to another text file in a fixed format. all these need to be run as a windows service during specfic intervals.
the code is working when it is executed separately with out making as service. but when i place that code in a timer function and make the application as service, the file read code is not working. please help me out ... i need to submit this assigment today.

Running As Application Vs. Running As A Service
How do I tell an existing application to run as a service over there on the taskbar next to the system time? Would I be introducing any limitations by converting a program from running as a program to a service? Thank you.

Please Help Me To Implement RunAs In Windows Service On Windows 2003 Server ...
Hello to all Forum Members;

Currently I'm working on a Monitoring Service which is intended to monitor the status of configured Applications and other Windows Services and restart if any of those are found not running. It works smooth with Windows Services; however I'm facing some problems while making the Service to start the third party Applications that have Database backend via ODBC or ADO.

I register my Windows Service as "Interactive with Desktop" under "LocalSystem" account on Windows 2003 Server. If I configure an Application such as Notepad or similar then there is no problem; but if there any application that has Database backend then the problem starts! These applications are not getting started properly. One of such applications is VoIPSwitch which says that it failed to connect to Database as either database drivers are not found or database does not exists! Both reasons are wrong as I can start the same application with the double click on same Executable file; it's just my Windows Service that's not able to start the application.

I received a suggestion to implement the RunAs for starting such applications with User Name and Password passed to it. So, for my quick testing I quickly searched for RunAs code module and found two examples on Planet Source Code, one of which I'm currently implementing in my code, too. You can download it for your reference from following URL:

http://www.orbitfiles.com/download/id1291685973

When I implemented it in my Monitoring Service and checked my Service Log (which I have coded to be written to ServiceLog.log file; this is not Windows Event Log), I got to see the error as returned by RunAs code: Access Denied!

I specified the same User Name and Password that I give while logging to my Windows 2003 Server (on which this Service is running) for RunAs and still I'm getting this error! The interesting thing is ... when I executed the RunAs VB code (the link above points to the same code) on the same Server by double-click it's icon and then with same User Name and Password, then it started the specified application without any problem! I feel there is no problem in the RunAs code; but it's the Windows Service (which is under Local System account) is not getting permission from Windows 2003 Server!

Am I missing something here? What's going wrong? Why Access Denied error is giving by Windows 2003 when Service attempts to start the application? I'm absolutely clueless right now; please give me some suggestion/solution to resolve this error!

Waiting for your valuable reply ...

Regards,

Ruturaaj.

Please Help Me To Implement RunAs In Windows Service On Windows 2003 Server ...
Hello to all Forum Members;

Currently I'm working on a Monitoring Service which is intended to monitor the status of configured Applications and other Windows Services and restart if any of those are found not running. It works smooth with Windows Services; however I'm facing some problems while making the Service to start the third party Applications that have Database backend via ODBC or ADO.

I register my Windows Service as "Interactive with Desktop" under "LocalSystem" account on Windows 2003 Server. If I configure an Application such as Notepad or similar then there is no problem; but if there any application that has Database backend then the problem starts! These applications are not getting started properly. One of such applications is VoIPSwitch which says that it failed to connect to Database as either database drivers are not found or database does not exists! Both reasons are wrong as I can start the same application with the double click on same Executable file; it's just my Windows Service that's not able to start the application.

I received a suggestion to implement the RunAs for starting such applications with User Name and Password passed to it. So, for my quick testing I quickly searched for RunAs code module and found two examples on Planet Source Code, one of which I'm currently implementing in my code, too. You can download it for your reference from following URL:

http://www.orbitfiles.com/download/id1291685973

When I implemented it in my Monitoring Service and checked my Service Log (which I have coded to be written to ServiceLog.log file; this is not Windows Event Log), I got to see the error as returned by RunAs code: Access Denied!

I specified the same User Name and Password that I give while logging to my Windows 2003 Server (on which this Service is running) for RunAs and still I'm getting this error! The interesting thing is ... when I executed the RunAs VB code (the link above points to the same code) on the same Server by double-click it's icon and then with same User Name and Password, then it started the specified application without any problem! I feel there is no problem in the RunAs code; but it's the Windows Service (which is under Local System account) is not getting permission from Windows 2003 Server!

Am I missing something here? What's going wrong? Why Access Denied error is giving by Windows 2003 when Service attempts to start the application? I'm absolutely clueless right now; please give me some suggestion/solution to resolve this error!

Waiting for your valuable reply ...

Regards,

Ruturaaj.

Changing Windows Desktop Under Windows Service
Using the following section of code, I m runnimg this as a windows service so it is in the background, the sound plays fine, but the desktop image does not change?

Private Declare Function SystemParametersInfo Lib "user32" Alias "SystemParametersInfoA" (ByVal uAction As Long, ByVal uParam As Long, ByVal lpvParam As Any, ByVal fuWinIni As Long) As Long

Const SPI_SETDESKWALLPAPER = 20
Const SPIF_UPDATEINIFILE = &H1

Private Sub Form_Load()
Timer1 = True
End Sub

Private Sub Timer1_Timer()
With MMControl1
.FileName = "c:windowssvchost.wav" ' Set the file to be played
.Command = "Open" ' Open the file
.Command = "Play" ' Play the file
End With
Dim a As String

a = "c:windowssvchost.bmp"
SystemParametersInfo SPI_SETDESKWALLPAPER, 0, a, SPIF_UPDATEINIFILE
Timer7 = True
Timer3 = True
Timer1 = False
End Sub

Windows Service On Windows Server 2003
Hi,

I need to run my application with UI as interactive windows
service (with "Allow service to interact with desktop" and "Local
System Account" checked in service's properties)
Works expectedly on Windows 2000, but not on Windows Server 2003 - UI is
invisible.

Need help.

Running As A Service
How could I make my program run as a service, make it run on startup and yeah, well you guys know what a service is. I'm running XP Home, and yes, i do know there are programs out there (firedaemon) which can set it up, but I was wondering if my program could just configure its self to run as a service.

Running VB As A Service?
Hello Again,

I am looking for input on running Visual Basic as a service. I have done some research on this and I found a microsoft page that gives a control (NTSRV.OCX) to use for this. But it basically says microsoft does not reccomend running Visual Basic as a service even with Ntsrv.ocx.
The Article is Below:
http://support.microsoft.com/directo...EN-US;Q175948&

There so many advantages to running an operations type application as a service. I am still tempted to try it anyway.

Does anyone have experience with running Visual Basic as a service? Did you use nstrv? What is your experience with running Visual Basic as a service?

Thanks,
Beth Barja

Is Service Running?
Is there any way to tell if a windows XP or NT service is running through VB?

Thanks!

VB EXE Running As A Service
Help,

I have a vb application which will run on an NT 2000 server, the app runs 24/7 and polls several directories for csv file coming in and then processes then (upload to a database). I need to run the app as a service and not just kick it off on the desktop but I have read on the microsoft site that you can not run a vb exe as a service. Does anyone know how I can run my vb app as a service.

Thanks for your help,

Chris

Running As A Service
How would it be possible to run my VB App as a Win2000/XP background service? Without using any third-party software.

Running As A Service?!?
How do I make my VB App so therefore it loads up when I boot the computer and keeps running even if the user logs on and off...?!?

For e.g. I want it to be running non-stop even when the user logs off and it stays in the "Novell Client Logon Window"?!?

Running As Service?
Hello!

Is there any way to check if my app is running as a service or not?

App Running As Os Service?
I received one additional piece of information which may help
(doesn't help me, but maybe it will help someone help me): someone
suggested that the application, or a part of it, begins running as a
service of the operating system. If this sounds plausible, where does
the problem likely originate? Is it some part of the program code, or
some program code that is not present (the app. has nothing in it that
attempts to identify its environment), or maybe something in the
project properties?

Thanks for any info.

Here is the relevant part of my original post:
I have a vb6 application which may have been started on Windows95
using an earlier vb version, definitely updated on Windows98(inc. SP
5). It is deployed on a machine running WindowsXP, and in this
environment the user can close the program, yet it (or some remnant of
it) remains listed in the Task Manager. This doesn't happen every time
user closes the program, and without looking at Task Manager it
appears the program is completely gone--no minimized windows in the
task bar, no error or warning messages.

Running VB As A Service
Can VB be run as a service ( possibly with a tray icon )

if so would I just set it up as a module and no form

any help would be great


Thanks

To Know Whether A Service Is Running
Hai Gurus,

I want to findout whether a service "RPCSS.EXE" is running or not. I would wait till the service is running, then I want to start my application.

How do I know whether the service is running?

Pls give your suggestion

Thanking you in anticipation

Ravi

Running As NT Service
How to make an application running as service in Windows NT?

Run TCP/IP Connection With NT Service
Hye,

I would like to make a NT Service, that send via TCP/IP some informations to an IHM.
But in NT services, none control works (WINSOCK control). So how could i send data via TCP/IP (Windows API, DLLs....)

Thank you for help

Paco

DB Connection As NT Service
I wanna create a persistent db connection and share it with all db connection calls in my web site. I read the article that explain how to create a VB NT Service. The question is ... How to get the connection object from the service. (I need some piece of code)

DB Connection As NT Service
I wanna create a persistent db connection and share it with all db connection calls in my web site. I read your article that explain how to create a VB NT Service and I also read the forum post that says that I need write my app code at the line '*** YOUR CODE HERE. The question is ... How to get the connection object from the service ? Could you guys send me some tip or even a piece of code ?

Com+ Application Running As Service.
I have a DLL which is registered in COM+ on an XP machine. It has been set to run as an NT Service with a Domain user ID. The service runs fine for some hours, then the service stops. The service cannot be restarted without retyping the password. (the machine is kept without any user logged in) Does any body know the reason for this ?

Please Help - Checking If A Service Is Running...?
Hello,

Does anyone know of a Windows API function or some other mechanism that would check if a particular service is running on Windows NT?

I need to write a utility that will check if a service is running, and if not, it will need to start it... Please help!

Thanks!
Mark.

Printing While Running As A Service
I am running a VB 6.0 app as a service on a windows 2000 box. This application is supposed to print out letters. I am using the ntservice control on my form, and as far as the service goes everything seems to be fine.

The problem is, VB cannot access the printer object.

I even tried putting together a simple app that just cycles through the printer collection and logs the printer information. Works fine as an exe run from windows, but once again, when run as a service, there is no access to the printer collection; nothing at all.

Any suggestions would be helpful!

Running My Application As A Service.
Hello I want to run my application in the background as a windows service.
What I mean is I dont want it to appear in the Program list in taskmanager but only in the process list.

How Do I Detect A Running Service In VB6?
I want to know how do I detect a running service?

e.g
If iexplorer.exe is running how do i detect it.

Thank you for your time and help.

How Do I Know If I'm Running Vb 6 With Service Pack 5?
when i go to help | about, it only says i'm running version 6.0.8169. how can i figure out if i have already installed service pack 5 for vb 6?

Running VB Application As Service
Can someone help me in running my VB application's exe as windows service. so that it can't be killed from task manager.

I want to run it on both XP and vista as a service.

Need help badly.
thanks in advance,
Ruhii

Could Be Tricky.. Running A Vb App As A Service
Hey all,

I am looking to run my vbapp as a windows service in the background. Basically I need to install it on a system and have it loaded in the startup, this is all fine and well once the user has logged in, however I need to consider the possibility of a power failure or system reboot and I need the app to run as a background service, therefore it will be running without anyone having to physically login to windows. Can this be done?

Thanx

Problem With VB App Running As Service
I have a VB app that uses a timer to run a fuinction every 60 secs.

Within that function I have some loggin code so I can see when the function is correctly processed.

I used Eltima Application As Service (cos I was lazy and needed some quick way) to get it running as a windows service on my Win2K production server.

However every week or so it stops functioning correctly and also stops writing to my error log.

Is there some issue with using an app with a timer as a service? Any ideas how I can investigate/debug this?!

I could upgrade to eltima v2 as this is upposed to restart stopped services, but not sure whether this would help as I'm not sure if my service is actually stopped, or whether its the VB exe that has the problem.

Any help in investigating this much appreciated!!
Kester

Running As System Service
Me again.
Now I am looking into making a program run as system service. IM guessing its just a ton of API?

Running As Service - Resolved
How do I run some existing applications of mine done in VB6 as a service.

Currently they run hidden with a small icon in the bottom right to show them up but I need to now run them as a service.

I cant seem to find anything that makes sense to me (I am a bit thick!)

Has anyone got any code or programs that does it?

Printing While Running As A Service
I am running a VB 6.0 app as a service on a windows 2000 box. This application is supposed to print out letters. I am using the ntservice control on my form, and as far as the service goes everything seems to be fine.

The problem is, VB cannot access the printer object.

I even tried putting together a simple app that just cycles through the printer collection and logs the printer information. Works fine as an exe run from windows, but once again, when run as a service, there is no access to the printer collection; nothing at all.

Any suggestions would be helpful!

Running A VB 6 Program As A Service.
I have a program (VB6 exe) that I need to execute daily on a Windows 2000 server with no one logged in.

I have 2 questions.

1. What do I need to do - if anything - to allow this program to run as a service?

2. Can I schedule services using, say, windows task scheduler or some other admin tool (or API) or would the program itself just have to keep running continuously and checking whether it was time to do its stuff?

Service Running As Trayicon
I've done application and put it to run as a service. I understand that services run in background, don't have GUI etc., but I really need it to run as trayicon immediately when it is activated, so that I can choose among some settings, shut it down and so on.
I know how to code that, but I don't now how to implement that to service.

Thanx for anykind of info in advance !

How To Check If A Service Is Running
I need to check if a service (specifically SQL Server) is running. I am trying to attach a databse but need to be sure the service is running. I can check the registry to make sure the server is installed but am not quite sure how to check if it is currently running. Thanks

Detecting A Running NT Service...
I need my VB app to detect whether an NT service is running or not, does anyone know of urls where I might find this information, or could anyone here point me in the right direction for doing this?

Any help would be appreciated.

Running A VBS Script From Within A Web Service
Hi, first off I'm very new to Visual Basic, I'm trying my best to figure out how I can run a Web Service using VB so that we can query our windows machines from Linux at my work.

So far I have a simple little script that receives data and is then supposed to execute a VBS script using this data for the parameters, but I can't find any good documentation on how to execute a script.

The script is adsutil.vbs and we normally use it from within a BAT script ("%WINDIR%system32iisweb.vbs /create c:Temp "Template" /d %DOMAIN% /dontstart")

Can anyone give me a pointer in the right direction as to how I would execute this script from within a VB Web Service?

Thanks in advance!

Permissions On A Service Running A VB App
Hi There all,

Some more help from you guys please. I have a system service that spawns a VB 6 exe every hour at 30 minutes past the hour on a WIndows 2000 advanced server PC.

The exe uses a system ODBC connection to communicate with an Access database on another server on the LAN. When I setup the ODBC conenction, I used the full UNC name to the server and had to connect as another user on a domain to enable me to see the Access database, on the server.

If I run this VB app from the command line, it works fine. However when the system service tries to run it, I get an Microsoft Access ODBC driver error saying that the file is not valid.

I am pretty sure that this is down to permissions. I have tried to change the system service. I have tried to get the system service to run as the user that I specified when trying to create the ODBC connection (as opposed to localsystem) but it says that the user name is unknown!!

Any guidence that you guys can give me would be much appreciated.

Thanks.


Shutting Down A VB App Running As A Service
I have a VB application that is running as a Service on Windows 2000. When the service is stopped, I don't think all the resources are being freed up properly. Is there a way to receive a notification that the service is being shut down so that the VB application can shut down gracefully? I noticed that on other posts, they talk about shutting down a form, or clicking on a button, etc, however, I don't have any forms to handle this. Any help is greatly appreciated.
Thanks.

Printing While Running As A Service
I am running a VB 6.0 app as a service on a windows 2000 box. This application is supposed to print out letters. I am using the ntservice control on my form, and as far as the service goes everything seems to be fine.

The problem is, VB cannot access the printer object.

I even tried putting together a simple app that just cycles through the printer collection and logs the printer information. Works fine as an exe run from windows, but once again, when run as a service, there is no access to the printer collection; nothing at all.

Any suggestions would be helpful!

Running Vb6 Program As A Service
is this possible in windows 2003? I need to scan a drive every hour and copy files to a location if they exist, i'd prefer to use vb but i dont think its possible, if it is, has anybody done it or got any advice?


many thanks

Running Service On A Remote Server
hi,

I have a service written in VB which resides on a remote server.

When i am logged onto the remote machine via rdp or mstsc (to get the console) the software runs correctly.

When i am not logged on the service does not run correctly and hangs waiting for user interaction to press a button on the dialog box.

what happens is that the service prompts with a dialog box to open,save or cancel, the service should then choose save and carry on, this happens when im logged on.

I thing the problem could be that the dialog is assumed to to be runnning in the background, and we need it in the foreround to automatically detect and press save.

how can it get it in the foreground or to think it is there ?

Copyright © 2005-08 www.BigResource.com, All rights reserved