NetTalk Central

Author Topic: NT app running as a service, using MySQL  (Read 3786 times)

Devan

  • Full Member
  • ***
  • Posts: 230
    • View Profile
    • Email
NT app running as a service, using MySQL
« on: November 14, 2011, 04:55:53 PM »
Hi all,

This may be vaguely related to the other recent thread on using MSSQL with NetTalk, but we have developed a NetTalk app that runs as a service, using MySQL (via MyODBC 3.1).

When testing the app, I ran is as just a normal Win32 program (not as a service) and everything works great.  However, as soon as I install and run is as a Service, the app cannot connect to the data via ODBC.

I have set up the MyODBC DSN as a 'System DSN' but that doesn't seem to help.  I am guessing it is to do with the logon credentials that the service is using, and whether that logon account can see the DSN?

Cheers,
Devan

Stu

  • Hero Member
  • *****
  • Posts: 510
    • View Profile
    • Email
Re: NT app running as a service, using MySQL
« Reply #1 on: November 15, 2011, 05:27:11 AM »
Devan,

Are you using SelfService?

I ran into a problem with SelfService and Nettalk where it turned out (can't remember why) that I needed to have the Webserver as the MAIN procedure in the app. Initially I had my webserver running with a Main MDI window and the Webserver coming off that. Bad mojo.

The other problem I seem to remember is that IF it's a multi-dll app there is some code you have to run to get the right PATH. So that if you are getting your sql settings from an INI file, it might be a problem. Check the following faq in the SelfService documentation .. D6) Setting the datapath in Multi-DLL Service applications.
Cheers,

Stu Andrews

Devan

  • Full Member
  • ***
  • Posts: 230
    • View Profile
    • Email
Re: NT app running as a service, using MySQL
« Reply #2 on: November 17, 2011, 03:57:23 PM »
Thanks for the reply Stu!

Yes, I am using SelfService in this instance.  The app is NOT multi DLL, and the WebServer window is the main (Non MDI) window of the app.

I am at a bit of a loss to explain this, as I think I am doing everything correct.

The hosting environment is a Windows 2008 Server running on an Amazon EC2 instance if that helps.  Not sure if there is Windows 2008 security setting somewhere that is preventing my app from seeing the DSN?

In the same environment, if I remove the app as a service and run normally, it works fine.  As soon as I make it a service, it cannot find the DSN!  Weird...

Devan

Stu

  • Hero Member
  • *****
  • Posts: 510
    • View Profile
    • Email
Re: NT app running as a service, using MySQL
« Reply #3 on: November 17, 2011, 05:57:43 PM »
What I did was get right into the guts armed with Debug()  - sends to DebugView.

Discovered a lot of stuff that way.
Cheers,

Stu Andrews

kevin plummer

  • Hero Member
  • *****
  • Posts: 1195
    • View Profile
    • Production Accounting and Software Payroll
Re: NT app running as a service, using MySQL
« Reply #4 on: November 17, 2011, 08:17:46 PM »
Stu's right. Add some debug points to where you are setting the DNS. Sounds like it could be a permissions issue whilst running as a service. Also try hard coding the DNS as if that works (or not) could also give you some clues as to where to start looking.