Jump to content

Database Connection via UDL


Recommended Posts

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

  • 1 month later...

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

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
Link to comment
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.

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...