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
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]
Just scatter shooting here, but I'm wondering if you could attempt to connect and then re-attempt to connect if you get an error.
Not sure if this would help but here's some code I use to make DSN-less connections:
* Set SQL TimeOut Wait =SQLSETPROP(0,"ConnectTimeOut",3)
* Suppress ODBC error dialog =SQLSETPROP(0,"DispWarnings",.f.)
* Suppress login dialog =SQLSETPROP(0,"DispLogin",3)
CLEAR ERROR lnConnection = SQLSTRINGCONNECT(lcDSNLess,.T.) lnErrorRows = AERROR(laError) IF lnConnection < 0
lcErrMsg = '' FOR lnLoopCnt = 1 TO 7 && Display all elements of the array lcErrMsg = lcErrMsg + TRANSFORM(laError(lnLoopCnt)) + CHR(13) ENDFOR
= MESSAGEBOX('Cannot make connection' + CHR(13) + lcErrMsg + CHR(13) + lcDSNLess, 16, 'SQL Connect Error') lnConnection = -1 ELSE
= SQLSETPROP(lnConnection, "PacketSize", 4096 )
ENDIF
Hope this helps!
Paul H. Tarver Tarver Program Consultants, Inc.
-----Original Message----- From: ProfoxTech [mailto:profoxtech-bounces@leafe.com] On Behalf Of Philip Borkholder Sent: Tuesday, June 18, 2024 8: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]