Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

UDL File Connection 1

Status
Not open for further replies.

dolfo35

Programmer
Jan 26, 2001
28
US
Hi,

Can someone please tell me what I am missing here:

Dim conn2 As New SqlConnection
conn2.ConnectionString = "File Name=c:\tempdb.udl;"

conn2.Open()

Every place I've read about using a UDL file to connect to SQL Server has said to use "File Name=path\filename.udl". However , I keep getting an error that says "Keyword not supported: 'file name'.

Your help is greatly appreciated.
Rudy
 
Using a .udl file for a connection string works with OleDbConnection, not SqlConnection. Try this:

Dim conn2 As New OleDbConnection
conn2.ConnectionString = "File Name=c:\tempdb.udl;"

I used to rock and roll every night and party every day. Then it was every other day. Now I'm lucky if I can find 30 minutes a week in which to get funky. - Homer Simpson
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top