PC Review


Reply
Thread Tools Rate Thread

RE: OLE DB Data Link dialog

 
 
Steven Bras [MS]
Guest
Posts: n/a
 
      3rd Oct 2003
I don't believe there is native code to do this; you must set references to
both the "adodb" .Net assembly and the OLEDB32.dll via the COM references
list in your project.

This will add references to MSDASC and OLEDBError. Then use the following
code to obtain a valid OLE DB connection string:

Dim oOLE As New MSDASC.DataLinks
Dim oConn As ADODB.Connection

oConn = oOLE.PromptNew()

MessageBox.Show(oConn.ConnectionString)

The promptNew method returns an ADO connection object, from which you can
read the ConnectionString property. Be sure to destroy the ADO connection
object when you're done with it.

There's also a PromptEdit() method that accepts an ADODB connection object
as a parameter, and will display the data link dialog set to the connection
information it finds on that connection object.

Hope this helps!

Steven Bras, MCSD
Microsoft Developer Support/Data Access Technologies

This posting is provided "AS IS" with no warranties, and confers no rights.

Microsoft Security Announcement: Have you installed the patch for Microsoft
Security Bulletin MS03-026?* If not Microsoft strongly advises you to
review the information at the following link regarding Microsoft Security
Bulletin MS03-026
http://www.microsoft.com/security/se...s/ms03-026.asp and/or to
visit Windows Update at http://windowsupdate.microsoft.com to install the
patch. Running the SCAN program from the Windows Update site will help to
insure you are current with all security patches, not just MS03-026.



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Importing data: OLE DB and data link properties dialog =?Utf-8?B?Vml2ZWs=?= Microsoft Excel Programming 0 22nd Oct 2007 04:03 PM
Importing Data: OLE DB and data link properties dialog =?Utf-8?B?Vml2ZWs=?= Microsoft Excel Crashes 0 22nd Oct 2007 04:02 PM
Importing data: OLE DB and data link dialog properties dialog =?Utf-8?B?Vml2ZWs=?= Microsoft Excel Crashes 0 22nd Oct 2007 04:00 PM
Importing Data: OLE DB and data link properties dialog =?Utf-8?B?Vml2ZWs=?= Microsoft Excel Misc 0 22nd Oct 2007 03:59 PM
OLE! O-LE! OLE! OLE! =?Utf-8?B?Um9iYnk=?= Microsoft Access Form Coding 0 10th Dec 2004 08:07 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:35 PM.