When you create a UDL file from a LabVIEW VI, you would access that from the menu Tools»Create Data Link...
. Chosing the Microsoft OLE DB Provider for SQL Server
option, you could proceed through the rest of the connection details with the following details:
- Server name = myServer/myInstance
- User name = myUsername
- Password = myPassword
- Allow saving password
- Database = myDatabase
After clicking OK
, you would generate a UDL file, containing the following string:Provider=SQLOLEDB.1;Password=myPassword;Persist Security Info=True;User ID=myUsername;Initial Catalog=myDatabase;Data Source=myServer\myInstance
We can interpret the string in the following way:
- Provider=SQLOLEDB.1: The OLE DB provider is "Microsoft OLE DB Provider for SQL Server"
- Password=myPassword: The password is "myPassword"
- Persist Security Info=True: You will allow saving the password (password is saved in the udl file)
- User ID=myUsername: The user name is "myUsername"
- Initial Catalog=myDatabase: The name of the database on the server is "myDatabase"
- Data Source=myServer\myInstance: The server name is "myServer" and the instance name is "myInstance"
Comparing this string with the one in the connection string in the ActiveX call, we can see that there is an extra string Integrated Security=SSPI
. By removing this string, the call to the database should work.