Create String Connection


Private sub cmdNew_Click()
On Error GoTo Err
‘Create Data Links
Dim objDLink As New DataLinks
Dim strCon As String

‘open dialog box
strCon=objDLink.PromptNew
Me.txtStr.Text=strCon
Exit Sub

Err:
Me.txtStr.text=vbNullString
End Sub

Private Sub cmd_Click()
On Error GoTo Err
Dim objDLink As New DataLinks
Dim cnn as New Connection
Dim strCon As String

cnn.ConnectionString=Me.txtStr.Text
strCon=objDLink.PromptEdit(cnn)
Me.txtStr.Text=cnn.ConnectionString
Exit sub

Err:
MsgBox (Err.Description)
Me.TxtStr.Text=vbNullString
End Sub

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s