Share via


IDataSourceLocator

Created for reference use in Visual Basic. Provides implementation for the promptNew and promptEdit methods.

Method

Description

HWnd

The parent window handle for the dialog box to be displayed in.

PromptEdit

Returns a Boolean value: true if the OK button was pressed on the dialog box; false if Cancel was pressed.

PromptNew

Displays the Data Link Properties window in its wizard mode. Returns a connection string.

Visual Basic 6.0 Example

Dim strConn as String
Dim objDataLinks as DataLinks
Dim bolStatus as Boolean
Dim cnn as ADODB.Connection

Set cnn = New ADODB.Connecton
Set objDataLinks = New Datalinks

' Get user's first settings for the connection.

StrConn = ObjDataLink.PromptNew
MsgBox(strConn)

' Assign the settings to the connection object.

cnn.ConnectionString = strConn

' Display connection properties for editing.

bolStatus = objDataLinks.PromptEdit(cnn)
If bolStatus = False Then
   MsgBox("Changes were canceled")
Else
   MsgBox("New settings are: " & cnn.ConnectionString)
End If

Set objDataLinks = Nothing
Set cnn = Nothing

Comments

To create a reference to IDataSourceLocator in Visual Basic

  • From the Project menu, select References. The References dialog box appears, listing the available references. Select the Microsoft OLE DB Service Component 1.0 Type Library check box.

This topic is a part of: