Dron писал(а):Как программно открыть свойства подключения к данным adodk??
With Conn
.ConnectionString = m_DefaultConnectionString
.Provider = "sqloledb"
' Valid Enums for the ADO Prompt property are:
' adPromptAlways = 1
' adPromptComplete = 2
' adPromptCompleteRequired = 3
' adPromptNever =4
.Properties("Prompt") = adPromptAlways
.CursorLocation =
.Open m_DefaultConnectionString
End With
Private Sub cmdConnect_Click()
On Error GoTo err_debug
Dim cn As ADODB.Connection
Dim dl As MSDASC.DataLinks
Dim b As Boolean
Set cn = New ADODB.Connection
cn.ConnectionString = VBA.GetSetting(App.Title, "Connect", "ConnectionString", gConnStr)
Set dl = New MSDASC.DataLinks
b = dl.PromptEdit(cn)
If b Then
cn.Open
Me.txtConnect = cn.ConnectionString
VBA.SaveSetting App.Title, "Connect", "ConnectionString", cn.ConnectionString
End If
lb_out:
Set cn = Nothing
Set dl = Nothing
Exit Sub
err_debug:
Resume lb_out
End Sub
Dim cn As ADODB.Connection
Dim dl As MSDASC.DataLinks
Dim b As Boolean
Set cn = New ADODB.Connection
cn.ConnectionString = VBA.GetSetting(App.Title, "Connect", "ConnectionString", gConnStr)
Set dl = New MSDASC.DataLinks
b = dl.PromptEdit(cn)
If b Then
cn.Open
Me.txtConnect = cn.ConnectionString
VBA.SaveSetting App.Title, "Connect", "ConnectionString", cn.ConnectionString
End If
Сейчас этот форум просматривают: Majestic-12 [Bot] и гости: 120