SQL Programming
Sql Connect
Gravatar is a globally recognized avatar based on your email address. Sql Connect
  Josh Klein
  All
  Feb 14, 2020 @ 01:29pm

Using a windows Server 2016 and Web Connection 7.9. wwSQL.connect will work successfully when running directly from VFP. When using the Web Connection Handler either file or com service the system fails with the following error:

Cannot open database "MyTestSqlData1" requested by the login. The login failed. [1526:4060]

The connection string is :

oSql.connect("driver={SQL Server};server=aries;database=MyTestSqlData1;UID=myusername;pwd=mypassword;Trusted_Connection=Yes;")

Thanks,

Josh

Gravatar is a globally recognized avatar based on your email address. re: Sql Connect
  Josh Klein
  Josh Klein
  Feb 14, 2020 @ 03:03pm

The sql server logs think the user is the computer name not the login name in the connection string. The domain does not have a user with the same name as the computer name. What is the best solution for this?

Thanks,

Gravatar is a globally recognized avatar based on your email address. re: Sql Connect
  Rick Strahl
  Josh Klein
  Feb 14, 2020 @ 06:11pm

Remove the Trusted Connection=yes from the connection string. Trusted Connection is Windows Authentication and most likely the account the app is running under (SYSTEM or some special account) won't have access or rights to the SQL Server.

You should never use both uid/pwd and trusted connection in the same connection string. Use one or the other.

+++ Rick ---

© 1996-2024