Tech Tip: Database Access and the SQL Server
PRODUCT: 4D Server | VERSION: 11.3 | PLATFORM: Mac & Win
Published On: February 18, 2009
There is extensive documentation in the language reference and on 4D's website regarding the On SQL Authentication Database Method. This can be used to limit access to your database programmatically based on the username and password supplied when connecting, as well as the IP address of the user. A few important notes regarding the On SQL Authentication Database Method:
- If the method exists, then the internal 4D password system is ignored.
- To accept a connection, the method must both return True and the CHANGE CURRENT USER command must be called.
- When logging in using SQL LOGIN and the SQL INTERNAL constant, the On SQL Authentication Database Method is not called.
By default, connections to the 4D SQL Server use 4D's internal password system if the On SQL Authentication Database Method has not been created. This way you can simply use your existing password system if you would like.
Commented by Josh Fletcher on February 18, 2009 at 11:12 AM
The CHANGE CURRENT USER requirement is for 11.3 and higher. It was not required in 11.2.