VBcoders Browse New Submit Contact Sign In

No account? Register free

Forgot password?

Create an UDL-File from an ADO-ConnectionString

Andreas Hofmann  (1 Submission)   Databases/Data Access/DAO/ADO   Visual Basic 3.0   Intermediate   Wed 3rd February 2021

Creates an UDL-File (Universal Data Link) from an existing ADO-ConnectionString. Unfortunately the DataLinks-Object in the "Microsoft OLE DB Service Component 1.0 Type Library" provides some prompting dialogs to choose an ADO-Connection, but a save method to get an UDL-file is missing. So I coded this. Note that this wasn't as easy as it looks now, cause an UDL-file is no normal INI-file, although it seems to be one. The first thing is, that it must be saved in unicode. The second and very astonishing thing is, that the second line, which seems to be a missable comment, is very important and must be exactly as it is. Otherwise the UDL-file wont work! Comments and votes are welcome.

Inputs
ConnectionString As String, Filename As String

Assumes
Needs to have a reference to the "Microsoft Scripting Runtime".

Returns
None, but creates as file.

Side Effects
Overwrites the given Filename, if already exists.

Rate Create an UDL-File from an ADO-ConnectionString (3(3 Vote))
Create an UDL-File from an ADO-ConnectionString.bas

Create an UDL-File from an ADO-ConnectionString Comments

No comments yet — be the first to post one!

Post a Comment

0/1000 characters