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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using a Data Link File for Connection of Data Report

Status
Not open for further replies.

Shaul

Technical User
Apr 25, 2002
6
GB
Hi Everyone,

I have designed a data report using the Visual Basic Data report designer and the report works fine when I use a data environment.
My problem is that I have now moved the database to a remote pc on a LAN and I would like the flexibility to change the database location using a Microsoft Data Link(.udl) file.
I don't know how to use a udl file in a data environment. It does not let me specify "file name = myUdlFile.udl" anywhere - not in the ConnectionSource, not in the Data Environment Initialize method, NOWHERE!
Please can someone tell me how to use a udl file to specify the database location for a data report, either using it in the data environment or somewhere else.

Shaul
 
Shaul-

I don't know much about the .udl files. I would be very interested in learning about them. How do you create the udl file? How doe it work? How do you use them in your vb app?
 
hi bjd4jc,

A udl file is used to specify ADO connection parameters in a file.
The way to use it in a VB app is:
create and ADODB connection but do not specify a connection string.
Open the connection like this: conName.open "File Name "myUdlFile.udl" and all the connection parameters will be retrieved from the udl file.
To create a udl file:
1)open windows explorer and choose tools->folder options->View
2)untick the "hide file extensions for known file types"
3)create a new text file and rename it to change the extension to .udl, ignore the warning and that will create the udl file. then double click on it to choose the properties.

Shaul
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top