Hi Tracy, The SQLSETPROP() works once there is a connection I believe. SQLSTRINGCONNECT() also returns a negative 1 however, the ODBC Login screen pops up before that return. I'm trying to figure out a way to hide/stop that annoying ODBC SQL Login prompt. :-)
I think I'm going to see if the ConnectTimeOut can be added in the connection string.
Thank you,
---------- Original Message ---------- From: "Tracy Pearson" tracy@powerchurch.com To: profoxtech@leafe.com Subject: RE: VFP 8, ODBC connection to Azure SQL Server Pausing Date: Tue, 18 Jun 2024 10:18:04 -0400
I haven't worked with Azure SQL.
You could set some setting with SQLSETPROP() Function Look at ConnectTimeOut and DispLogin settings.
The SQLConnect function returns a -1 when the connection isn't created.
HTH, Tracy
-----Original Message----- From: ProfoxTech [mailto:profoxtech-bounces@leafe.com] On Behalf Of Philip Borkholder Sent: Tuesday, June 18, 2024 9:34 AM To: profoxtech@leafe.com Subject: VFP 8, ODBC connection to Azure SQL Server Pausing
Hello,
I have been having issues with MS Azure SQL Server going to a "pause state" at night after no activity. Then when I try to connect with :
lnConnection = SQLSTRINGCONNECT(lcConnString,.T.)
Because the Azure SQL Server is paused, the SQLSTRINGCONNECT() times out and prompts with the ODBC failed to connect and SQL Server login prompt.
This is annoying when I don't want that to pop up because the end user will not know what to do. All the help online just says an Azure SQL Server resumes once an attempt to connect is made...
Does anyone have any experience with this?
Is it a timeout issue that we can set in our connection string? Is there a setting on the Azure SQL server we need to set to not allow it to pause?
Thanks for any guidance,
Philip Borkholder Bison Tech Plus Vicksburg, MI
[excessive quoting removed by server]
Hi Philip,
I don't use the SQL connection ability in VFP often. I do remember it is possible to set the DispLogin on the VFP level using a 0 for the Connection parameter. I'm sure the ConnectTimeOut can be set that way as well.
Tracy
-----Original Message----- From: ProfoxTech [mailto:profoxtech-bounces@leafe.com] On Behalf Of Philip Borkholder Sent: Tuesday, June 18, 2024 2:21 PM To: profoxtech@leafe.com Subject: RE: VFP 8, ODBC connection to Azure SQL Server Pausing
Hi Tracy, The SQLSETPROP() works once there is a connection I believe. SQLSTRINGCONNECT() also returns a negative 1 however, the ODBC Login screen pops up before that return. I'm trying to figure out a way to hide/stop that annoying ODBC SQL Login prompt. :-)
I think I'm going to see if the ConnectTimeOut can be added in the connection string.
Thank you,
---------- Original Message ---------- From: "Tracy Pearson" tracy@powerchurch.com To: profoxtech@leafe.com Subject: RE: VFP 8, ODBC connection to Azure SQL Server Pausing Date: Tue, 18 Jun 2024 10:18:04 -0400
I haven't worked with Azure SQL.
You could set some setting with SQLSETPROP() Function Look at ConnectTimeOut and DispLogin settings.
The SQLConnect function returns a -1 when the connection isn't created.
HTH, Tracy
-----Original Message----- From: ProfoxTech [mailto:profoxtech-bounces@leafe.com] On Behalf Of Philip Borkholder Sent: Tuesday, June 18, 2024 9:34 AM To: profoxtech@leafe.com Subject: VFP 8, ODBC connection to Azure SQL Server Pausing
Hello,
I have been having issues with MS Azure SQL Server going to a "pause state" at night after no activity. Then when I try to connect with :
lnConnection = SQLSTRINGCONNECT(lcConnString,.T.)
Because the Azure SQL Server is paused, the SQLSTRINGCONNECT() times out and prompts with the ODBC failed to connect and SQL Server login prompt.
This is annoying when I don't want that to pop up because the end user will not know what to do. All the help online just says an Azure SQL Server resumes once an attempt to connect is made...
Does anyone have any experience with this?
Is it a timeout issue that we can set in our connection string? Is there a setting on the Azure SQL server we need to set to not allow it to pause?
Thanks for any guidance,
Philip Borkholder Bison Tech Plus Vicksburg, MI
[excessive quoting removed by server]
Pretty sure Tracy is right. Call SQLSetProp as he recommends, and then attempt to get your connection handle inside some sort of DO WHILE loop.
*** Show no login SQLSETPROP(0, 'DispLogin', 3) *** Show no warnings - fail and report as errors SQLSETPROP(0, 'DispWarnings', .F.) *** Connection Timeout in seconds SQLSETPROP(0, 'ConnectTimeout', <your preferred timeout value>)
(Pinched this particular set of commands from Rick Strahl's wwsql class...)
--
rk
From: ProfoxTech profoxtech-bounces@leafe.com On Behalf Of Tracy Pearson Sent: Tuesday, June 18, 2024 3:01 PM To: profoxtech@leafe.com Subject: RE: VFP 8, ODBC connection to Azure SQL Server Pausing
Hi Philip,
I don't use the SQL connection ability in VFP often. I do remember it is possible to set the DispLogin on the VFP level using a 0 for the Connection parameter. I'm sure the ConnectTimeOut can be set that way as well.
Tracy
-----Original Message----- From: ProfoxTech [mailto:profoxtech-bounces@leafe.com] On Behalf Of Philip Borkholder Sent: Tuesday, June 18, 2024 2:21 PM To: mailto:profoxtech@leafe.com Subject: RE: VFP 8, ODBC connection to Azure SQL Server Pausing
Hi Tracy, The SQLSETPROP() works once there is a connection I believe. SQLSTRINGCONNECT() also returns a negative 1 however, the ODBC Login screen pops up before that return. I'm trying to figure out a way to hide/stop that annoying ODBC SQL Login prompt. :-)
I think I'm going to see if the ConnectTimeOut can be added in the connection string.
Thank you,
---------- Original Message ---------- From: "Tracy Pearson" mailto:tracy@powerchurch.com To: mailto:profoxtech@leafe.com Subject: RE: VFP 8, ODBC connection to Azure SQL Server Pausing Date: Tue, 18 Jun 2024 10:18:04 -0400
I haven't worked with Azure SQL.
You could set some setting with SQLSETPROP() Function Look at ConnectTimeOut and DispLogin settings.
The SQLConnect function returns a -1 when the connection isn't created.
HTH, Tracy
-----Original Message----- From: ProfoxTech [mailto:profoxtech-bounces@leafe.com] On Behalf Of Philip Borkholder Sent: Tuesday, June 18, 2024 9:34 AM To: mailto:profoxtech@leafe.com Subject: VFP 8, ODBC connection to Azure SQL Server Pausing
Hello,
I have been having issues with MS Azure SQL Server going to a "pause state" at night after no activity. Then when I try to connect with :
lnConnection = SQLSTRINGCONNECT(lcConnString,.T.)
Because the Azure SQL Server is paused, the SQLSTRINGCONNECT() times out and prompts with the ODBC failed to connect and SQL Server login prompt.
This is annoying when I don't want that to pop up because the end user will not know what to do. All the help online just says an Azure SQL Server resumes once an attempt to connect is made...
Does anyone have any experience with this?
Is it a timeout issue that we can set in our connection string? Is there a setting on the Azure SQL server we need to set to not allow it to pause?
Thanks for any guidance,
Philip Borkholder Bison Tech Plus Vicksburg, MI
[excessive quoting removed by server]
IIRC* SQLSetProp() accepts a handle number as its first parameter; sending a 0 sets the default/global setting. See:
https://hackfox.github.io/section4/s4g399.html **
* This year on April 1st (no foolin') was the 30th anniversary of the release of HackFox3! (and it's been nearly 20 years since I was actively developing in VFP, but I did co-author the VFP Distributed certification exam and LEARNED that stuff!)
** This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.
On Tue, Jun 18, 2024 at 2:24 PM Philip Borkholder plborker@netzero.net wrote:
Hi Tracy, The SQLSETPROP() works once there is a connection I believe. SQLSTRINGCONNECT() also returns a negative 1 however, the ODBC Login screen pops up before that return. I'm trying to figure out a way to hide/stop that annoying ODBC SQL Login prompt. :-)
I think I'm going to see if the ConnectTimeOut can be added in the connection string.
Thank you,
---------- Original Message ---------- From: "Tracy Pearson" tracy@powerchurch.com To: profoxtech@leafe.com Subject: RE: VFP 8, ODBC connection to Azure SQL Server Pausing Date: Tue, 18 Jun 2024 10:18:04 -0400
I haven't worked with Azure SQL.
You could set some setting with SQLSETPROP() Function Look at ConnectTimeOut and DispLogin settings.
The SQLConnect function returns a -1 when the connection isn't created.
HTH, Tracy
-----Original Message----- From: ProfoxTech [mailto:profoxtech-bounces@leafe.com] On Behalf Of Philip Borkholder Sent: Tuesday, June 18, 2024 9:34 AM To: profoxtech@leafe.com Subject: VFP 8, ODBC connection to Azure SQL Server Pausing
Hello,
I have been having issues with MS Azure SQL Server going to a "pause state" at night after no activity. Then when I try to connect with :
lnConnection = SQLSTRINGCONNECT(lcConnString,.T.)
Because the Azure SQL Server is paused, the SQLSTRINGCONNECT() times out and prompts with the ODBC failed to connect and SQL Server login prompt.
This is annoying when I don't want that to pop up because the end user will not know what to do. All the help online just says an Azure SQL Server resumes once an attempt to connect is made...
Does anyone have any experience with this?
Is it a timeout issue that we can set in our connection string? Is there a setting on the Azure SQL server we need to set to not allow it to pause?
Thanks for any guidance,
Philip Borkholder Bison Tech Plus Vicksburg, MI
[excessive quoting removed by server]