netmatt Posted June 18, 2008 Share Posted June 18, 2008 Is there a way to connect to a SQL Server database using a pre-existing UDL file? Only one post in here with any mention of using a UDL, and that not helpful. Thanks! Link to comment Share on other sites More sharing options...
DaRam Posted June 18, 2008 Share Posted June 18, 2008 Is there a way to connect to a SQL Server database using a pre-existing UDL file? Only one post in here with any mention of using a UDL, and that not helpful. Thanks!ConnectionObject.ConnectionString = "File Name=C:\Path\To\UDL_File.UDL;" Link to comment Share on other sites More sharing options...
netmatt Posted June 18, 2008 Author Share Posted June 18, 2008 ConnectionObject.ConnectionString = "File Name=C:\Path\To\UDL_File.UDL;" Great thanks! I was missing the semi-colon... Link to comment Share on other sites More sharing options...
Bossie Posted July 29, 2008 Share Posted July 29, 2008 When I try this it returns an error. What am I doing wrong $sqlCon = ObjCreate("ADODB.Connection") $sqlCon.ConnectionString = "File Name=C:\Path\To\UDL_File.UDL;" $sqlCon.Open Before trying I downloaded the latest version, hopefully somebody can help me. Thanks! Link to comment Share on other sites More sharing options...
PsaltyDS Posted July 29, 2008 Share Posted July 29, 2008 When I try this it returns an error. What am I doing wrong $sqlCon = ObjCreate("ADODB.Connection") $sqlCon.ConnectionString = "File Name=C:\Path\To\UDL_File.UDL;" $sqlCon.Open Before trying I downloaded the latest version, hopefully somebody can help me. Thanks! Exactly what is the error? Do you have a COM error handler in your script? If so, what does it show? Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
Bossie Posted July 29, 2008 Share Posted July 29, 2008 Exactly what is the error? Do you have a COM error handler in your script? If so, what does it show? I didn't had a COM error handler yet. After adding this I saw the problem allready. "Error: Login failed for user '<user>'".Stupid me forgot to save the password in the UDL file, it's working fine now. Thanks for the quick advise. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now