Sign in to follow this  
Followers 0
netmatt

Database Connection via UDL

6 posts in this topic

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!

Share this post


Link to post
Share on other sites



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;"

Share this post


Link to post
Share on other sites

ConnectionObject.ConnectionString = "File Name=C:\Path\To\UDL_File.UDL;"
Great thanks! I was missing the semi-colon... :)

Share this post


Link to post
Share on other sites

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!

Share this post


Link to post
Share on other sites

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?

:P


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

Share this post


Link to post
Share on other sites

Exactly what is the error?

Do you have a COM error handler in your script? If so, what does it show?

:P

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.

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0