NetTalk Central

Author Topic: ReConnect to MSSQL DataBase  (Read 3599 times)

Matthew

  • Full Member
  • ***
  • Posts: 137
    • View Profile
    • Email
ReConnect to MSSQL DataBase
« on: June 21, 2013, 04:18:42 AM »
Hello.

I am using FM3 v. 5.09

I have some problem with connection to SQL DataBase.

1. I have single EXE program which checks in timer EVENT if some file exists in some folder on local disk and if exists then read this file and put data from this file to some database.
2. This program is connecting to DataBase on startup using FM3 SQL_Connect.
3. This program is on different physical machine than SQL DataBase.

1. How can I connect again to my DataBase without restart EXE program. when suddenly SQL Server stop working for a while and then start again (for example there is reboot system)?
2. How can I check if my connection to the SQL DataBase is still active (in timer EVENT)?

-------------------------------------------------------------------------------------------------------------------
When I try to run again SQL_Connet procedure I have STOP MESSAGE when SQL Server is still unattainable and then program is terminated - see attachmenet.

Regards,
Matthew

[attachment deleted by admin]
« Last Edit: June 21, 2013, 04:48:27 AM by Matthew »

kevin plummer

  • Hero Member
  • *****
  • Posts: 1195
    • View Profile
    • Production Accounting and Software Payroll
Re: ReConnect to MSSQL DataBase
« Reply #1 on: June 22, 2013, 01:48:21 AM »
your glo:dbowner should be threaded and populate this with the server,db,user,password in the processlink embed in the webhandler.

Matthew

  • Full Member
  • ***
  • Posts: 137
    • View Profile
    • Email
Re: ReConnect to MSSQL DataBase
« Reply #2 on: June 23, 2013, 11:45:49 PM »
Thank You Kevin for your answer.

I forgot to write that I am not using NetWebServer class, but NetServer and I have all the time one thread.

I run my EXE program which connect at startup to dababase and in timer event I do something operations. So how can I check if my connection to the SQL DataBase is still active and if not trying to connect again.

If I use again procedure SQL_Connect where I set FM3GLO:Connected = FALSE to trying connect againt it throw mi STOP MESSAGE and  program is terminated (attachement).

Anyone know how to checking connection to database and reconnect if necessary without close and run again application?

Regards,
Matthew

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: ReConnect to MSSQL DataBase
« Reply #3 on: June 23, 2013, 11:57:01 PM »
Hi Matthew,

This falls into the category of a "more general" Clarion question- and hopefully someone here with SQL knowledge can respond - but you may have more joy posting in the normal Clarion newsgroups. Phrase it as a "general" Clarion question, not mentioning the NetTalk bit (which is irrelevant to your problem) and you might get something useful.

I am definitely _not_ a SQL expert, but as I understand it, this is a problem for Clarion programs in general. But it may be solved in some Clarion version, or there may be techniques to use, or whatever.

cheers
Bruce