Hi.
Is there a way to set this property programmatically?
I have an example that will get you started, but this example requires that
the user fill in the blanks in the dialog window, so you'll have to expand
on its capabilities if you don't want the user to set those settings.
1. Set references to the Microsoft ActiveX Data Objects 2.x Library (if it
isn't set already) and the Microsoft OLE DB Service Component 1.0 Type
Library.
2. Create a CommandButton on a Form and name it DataLinkBtn.
3. Copy and paste the following code into the Form's code module, then save
and compile:
Private Sub DataLinkBtn_Click()
On Error GoTo ErrHandler
Dim MSDASCObj As MSDASC.DataLinks
Dim cn As ADODB.Connection
Set MSDASCObj = New MSDASC.DataLinks
Set cn = New ADODB.Connection
MSDASCObj.PromptEdit cn
cn.Open
MsgBox "Connection opened successfully."
cn.Close
CleanUp:
Set cn = Nothing
Set MSDASCObj = Nothing
Exit Sub
ErrHandler:
MsgBox "Error in DataLinkBtn_Click( ) in " & vbCrLf & Me.Name & " form."
& _
vbCrLf & "Error #" & Err.Number & vbCrLf & Err.Description
Err.Clear
GoTo CleanUp
End Sub
HTH.
Gunny
See
http://www.QBuilt.com for all your database needs.
See
http://www.Access.QBuilt.com for Microsoft Access tips and tutorials.
Blogs:
www.DataDevilDog.BlogSpot.com,
www.DatabaseTips.BlogSpot.com
http://www.Access.QBuilt.com/html/expert_contributors2.html for contact
info.