I have a VFP) app that uses MS sqlserver as backend. The SQL Server is located in a web provider
The connection is achieved by creating a DSN throught the ODBC driver in my PC
I need to deploy this app to several clients. But none of them should use their ODBC driver to create the connection, or install the applicable SQL Server Native Client in their PC.
The idea is that I would send them my VFP application exe and they would simply connect to the cloud SQL Server and run the app without any further operations to install the exe.
I tried SQLConnect and SQLStringConnect, but they always refer to an existing DSN
Is there a way to accomplish this without my clients intervention other than lodging the exe in the applicable directory in their PC's ??
Please advise and if possible, provide an example on how to do this
TIA
Rafael Copquin
--- StripMime Report -- processed MIME parts --- multipart/alternative text/plain (text body -- kept) text/html ---
Rafael,
They'll have to have the driver installed in order to talk to SQL Server. The best way is to provide them with an Installer program (use InnoSetup - free and easy) that installs your app as well as the driver. It can add a DSN too, although you may want to consider hardcoding that connection string into your EXE so the password isn't visible. Hopefully they're using a SQL account with the minimal privileges needed.
I hope this helps,
Eric
On Thu, Feb 11, 2021 at 6:50 AM Rafael Copquin rafael.copquin@gmail.com wrote:
I have a VFP) app that uses MS sqlserver as backend. The SQL Server is located in a web provider
The connection is achieved by creating a DSN throught the ODBC driver in my PC
I need to deploy this app to several clients. But none of them should use their ODBC driver to create the connection, or install the applicable SQL Server Native Client in their PC.
The idea is that I would send them my VFP application exe and they would simply connect to the cloud SQL Server and run the app without any further operations to install the exe.
I tried SQLConnect and SQLStringConnect, but they always refer to an existing DSN
Is there a way to accomplish this without my clients intervention other than lodging the exe in the applicable directory in their PC's ??
Please advise and if possible, provide an example on how to do this
TIA
Rafael Copquin
--- StripMime Report -- processed MIME parts --- multipart/alternative text/plain (text body -- kept) text/html
[excessive quoting removed by server]
Hi Eric, I was afraid they would need to install the driver. I'll try innosetup as you suggest
In any case, thank you both, Eric and Vince
Best regards Rafael
El jue, 11 feb 2021 a las 11:17, Eric Selje (Eric@saltydogllc.com) escribió:
Rafael,
They'll have to have the driver installed in order to talk to SQL Server. The best way is to provide them with an Installer program (use InnoSetup - free and easy) that installs your app as well as the driver. It can add a DSN too, although you may want to consider hardcoding that connection string into your EXE so the password isn't visible. Hopefully they're using a SQL account with the minimal privileges needed.
I hope this helps,
Eric
On Thu, Feb 11, 2021 at 6:50 AM Rafael Copquin rafael.copquin@gmail.com wrote:
I have a VFP) app that uses MS sqlserver as backend. The SQL Server is located in a web provider
The connection is achieved by creating a DSN throught the ODBC driver in
my
PC
I need to deploy this app to several clients. But none of them should use their ODBC driver to create the connection, or install the applicable SQL Server Native Client in their PC.
The idea is that I would send them my VFP application exe and they would simply connect to the cloud SQL Server and run the app without any
further
operations to install the exe.
I tried SQLConnect and SQLStringConnect, but they always refer to an existing DSN
Is there a way to accomplish this without my clients intervention other than lodging the exe in the applicable directory in their PC's ??
Please advise and if possible, provide an example on how to do this
TIA
Rafael Copquin
--- StripMime Report -- processed MIME parts --- multipart/alternative text/plain (text body -- kept) text/html
[excessive quoting removed by server]
On 02/11/21 9:20 AM, Rafael Copquin wrote: Hi Vince I understand your example. Actually I used it and my test worked like a charm. However, wouldn't it require that my clients have the SQL Server Native Client version already installed in their computers? Rafael
The drivers, yes, but those can be downloaded from Microsoft, and I believe installed with an installer, as per Eric.
Here is a powershell script example that will install the client on your workstation(s).
https://www.server-world.info/en/note?os=Windows_Server_2019&p=mssql2019...
I would skip ODBC at all costs and just use the client directly.
On Thu, Feb 11, 2021 at 8:17 AM Eric Selje Eric@saltydogllc.com wrote:
Rafael,
They'll have to have the driver installed in order to talk to SQL Server. The best way is to provide them with an Installer program (use InnoSetup - free and easy) that installs your app as well as the driver. It can add a DSN too, although you may want to consider hardcoding that connection string into your EXE so the password isn't visible. Hopefully they're using a SQL account with the minimal privileges needed.
I hope this helps,
Eric
On Thu, Feb 11, 2021 at 6:50 AM Rafael Copquin rafael.copquin@gmail.com wrote:
I have a VFP) app that uses MS sqlserver as backend. The SQL Server is located in a web provider
The connection is achieved by creating a DSN throught the ODBC driver in
my
PC
I need to deploy this app to several clients. But none of them should use their ODBC driver to create the connection, or install the applicable SQL Server Native Client in their PC.
The idea is that I would send them my VFP application exe and they would simply connect to the cloud SQL Server and run the app without any
further
operations to install the exe.
I tried SQLConnect and SQLStringConnect, but they always refer to an existing DSN
Is there a way to accomplish this without my clients intervention other than lodging the exe in the applicable directory in their PC's ??
Please advise and if possible, provide an example on how to do this
TIA
Rafael Copquin
--- StripMime Report -- processed MIME parts --- multipart/alternative text/plain (text body -- kept) text/html
[excessive quoting removed by server]
I do this with multiple applications and we handle it using a DSN-less connection. The only requirement for the pc is a 32-bit MS SQL ODBC driver must be installed, but no DSN needs to be created on the computer. Also, you must have SQL Credentials configured on the SQL Server as you cannot use Windows Authentication over ODBC.
Here's a short clip of the important parts of the SQLConnect.prg I use:
lcDSNLess = 'Driver=' + ALLTRIM(lcDriver) + ';' + ; 'Server=' + ALLTRIM(lcServer) + ';' + ; 'Uid=' + ALLTRIM(lcUid) + ';' + ; 'Pwd=' + ALLTRIM(lcPWD) + ';' + ; 'Database=' + ALLTRIM(lcDbName)
* 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)
Then check to see if lnErrorRows is greater than 0 to catch any errors.
If the lnConnection value is greater than 1, then you can start sending pass through commands and getting results.
Hope that helps!
Paul H. Tarver Tarver Program Consultants, Inc.
-----Original Message----- From: ProfoxTech [mailto:profoxtech-bounces@leafe.com] On Behalf Of Rafael Copquin Sent: Thursday, February 11, 2021 6:50 AM To: profoxtech@leafe.com Subject: sql server connection
I have a VFP) app that uses MS sqlserver as backend. The SQL Server is located in a web provider
The connection is achieved by creating a DSN throught the ODBC driver in my PC
I need to deploy this app to several clients. But none of them should use their ODBC driver to create the connection, or install the applicable SQL Server Native Client in their PC.
The idea is that I would send them my VFP application exe and they would simply connect to the cloud SQL Server and run the app without any further operations to install the exe.
I tried SQLConnect and SQLStringConnect, but they always refer to an existing DSN
Is there a way to accomplish this without my clients intervention other than lodging the exe in the applicable directory in their PC's ??
Please advise and if possible, provide an example on how to do this
TIA
Rafael Copquin
--- StripMime Report -- processed MIME parts --- multipart/alternative text/plain (text body -- kept) text/html ---
[excessive quoting removed by server]
Really? All you have to do is set trusted=yes in the conn string, afaik. But I could be wrong. We only use SQL security accounts in our environment.
I'm sure it's been mentioned before but this is a good resource for connection strings - https://www.connectionstrings.com/sql-server/
--
rk
-----Original Message----- From: ProfoxTech profoxtech-bounces@leafe.com On Behalf Of Paul H. Tarver Sent: Thursday, February 11, 2021 12:49 PM To: profoxtech@leafe.com Subject: RE: sql server connection
I do this with multiple applications and we handle it using a DSN-less connection. The only requirement for the pc is a 32-bit MS SQL ODBC driver must be installed, but no DSN needs to be created on the computer. Also, you must have SQL Credentials configured on the SQL Server as you cannot use Windows Authentication over ODBC.
Here's a short clip of the important parts of the SQLConnect.prg I use:
lcDSNLess = 'Driver=' + ALLTRIM(lcDriver) + ';' + ; 'Server=' + ALLTRIM(lcServer) + ';' + ; 'Uid=' + ALLTRIM(lcUid) + ';' + ; 'Pwd=' + ALLTRIM(lcPWD) + ';' + ; 'Database=' + ALLTRIM(lcDbName)
* 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)
Then check to see if lnErrorRows is greater than 0 to catch any errors.
If the lnConnection value is greater than 1, then you can start sending pass through commands and getting results.
Hope that helps!
Paul H. Tarver Tarver Program Consultants, Inc.
And installing the 64 bit driver will include the 32 bit driver.
--
rk
-----Original Message----- From: ProfoxTech profoxtech-bounces@leafe.com On Behalf Of Richard Kaye Sent: Thursday, February 11, 2021 1:05 PM To: profoxtech@leafe.com Subject: RE: sql server connection
Really? All you have to do is set trusted=yes in the conn string, afaik. But I could be wrong. We only use SQL security accounts in our environment.
I'm sure it's been mentioned before but this is a good resource for connection strings - https://www.connectionstrings.com/sql-server/
--
rk
-----Original Message----- From: ProfoxTech profoxtech-bounces@leafe.com On Behalf Of Paul H. Tarver Sent: Thursday, February 11, 2021 12:49 PM To: profoxtech@leafe.com Subject: RE: sql server connection
I do this with multiple applications and we handle it using a DSN-less connection. The only requirement for the pc is a 32-bit MS SQL ODBC driver must be installed, but no DSN needs to be created on the computer. Also, you must have SQL Credentials configured on the SQL Server as you cannot use Windows Authentication over ODBC.
Here's a short clip of the important parts of the SQLConnect.prg I use:
lcDSNLess = 'Driver=' + ALLTRIM(lcDriver) + ';' + ; 'Server=' + ALLTRIM(lcServer) + ';' + ; 'Uid=' + ALLTRIM(lcUid) + ';' + ; 'Pwd=' + ALLTRIM(lcPWD) + ';' + ; 'Database=' + ALLTRIM(lcDbName)
* 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)
Then check to see if lnErrorRows is greater than 0 to catch any errors.
If the lnConnection value is greater than 1, then you can start sending pass through commands and getting results.
Hope that helps!
Paul H. Tarver Tarver Program Consultants, Inc.
[excessive quoting removed by server]
I've not been able to make Windows Authentication work in the past, but I'll keep that in mind and try it again sometime. So far, my clients have been accommodating in terms of creating SQL Credentials. I also only need Read/Only rights for the work I do, so that helps with their security concerns as well.
Thanks!
Paul H. Tarver Tarver Program Consultants, Inc.
-----Original Message----- From: ProfoxTech [mailto:profoxtech-bounces@leafe.com] On Behalf Of Richard Kaye Sent: Thursday, February 11, 2021 12:05 PM To: profoxtech@leafe.com Subject: RE: sql server connection
Really? All you have to do is set trusted=yes in the conn string, afaik. But I could be wrong. We only use SQL security accounts in our environment.
I'm sure it's been mentioned before but this is a good resource for connection strings - https://www.connectionstrings.com/sql-server/
--
rk
-----Original Message----- From: ProfoxTech profoxtech-bounces@leafe.com On Behalf Of Paul H. Tarver Sent: Thursday, February 11, 2021 12:49 PM To: profoxtech@leafe.com Subject: RE: sql server connection
I do this with multiple applications and we handle it using a DSN-less connection. The only requirement for the pc is a 32-bit MS SQL ODBC driver must be installed, but no DSN needs to be created on the computer. Also, you must have SQL Credentials configured on the SQL Server as you cannot use Windows Authentication over ODBC.
Here's a short clip of the important parts of the SQLConnect.prg I use:
lcDSNLess = 'Driver=' + ALLTRIM(lcDriver) + ';' + ; 'Server=' + ALLTRIM(lcServer) + ';' + ; 'Uid=' + ALLTRIM(lcUid) + ';' + ; 'Pwd=' + ALLTRIM(lcPWD) + ';' + ; 'Database=' + ALLTRIM(lcDbName)
* 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)
Then check to see if lnErrorRows is greater than 0 to catch any errors.
If the lnConnection value is greater than 1, then you can start sending pass through commands and getting results.
Hope that helps!
Paul H. Tarver Tarver Program Consultants, Inc.
[excessive quoting removed by server]
-----Original Message-----
From: ProfoxTech [mailto:profoxtech-bounces@leafe.com] On Behalf Of Richard Kaye Sent: Thursday, February 11, 2021 12:05 PM To: profoxtech@leafe.com Subject: RE: sql server connection
Really? All you have to do is set trusted=yes in the conn string, afaik. But I could be wrong. We only use SQL security accounts in our environment.
Yeah, I use trusted=yes and leave pw and user blank all the time. I don't even bother to reset the SQL logins/users any more (for my own machine's databases)
Have you considered the firewall port requirements involved for your clients in the generally inadvisable process of exposing a SQL Server directly to the internet?
In our case, we require that our clients provide us with secure VPN access to their network. All of our development and support is done across this vpn connection and NOT to port open to the internet. Once our application is installed within their network access to their self-hosted SQL is already available. We never ask them to expose their SQL server directly to the internet.
Paul H. Tarver Tarver Program Consultants, Inc.
-----Original Message----- From: ProfoxTech [mailto:profoxtech-bounces@leafe.com] On Behalf Of Alan Bourke Sent: Friday, February 12, 2021 3:19 AM To: profoxtech@leafe.com Subject: Re: sql server connection
Have you considered the firewall port requirements involved for your clients in the generally inadvisable process of exposing a SQL Server directly to the internet?