-
Notifications
You must be signed in to change notification settings - Fork 32
/
ADOConnection.bas
56 lines (46 loc) · 1.66 KB
/
ADOConnection.bas
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
Attribute VB_Name = "ADOConnection_Module"
Option Explicit
Public Sub CreateNewADOConnection()
' #VBIDEUtils#************************************************************
' * Author : removed
' * Web Site : http://www.ppreview.net
' * E-Mail : removed
' * Date : 02/28/2001
' * Time : 22:31
' * Module Name : ADOConnection_Module
' * Module Filename : ADOConnection.bas
' * Procedure Name : CreateNewADOConnection
' * Purpose : Create easily an ADO connection string
' * Parameters :
' **********************************************************************
' * Comments :
' * Create easily an ADO connection string and copies it to the clipboard
' *
' * Example :
' * Call CreateNewADOConnection
' *
' * See Also :
' *
' * History :
' *
' *
' **********************************************************************
' #VBIDEUtilsERROR#
On Error GoTo ERROR_CreateNewADOConnection
Dim objDataLink As New DataLinks
Dim sConnection As String
Dim sMsgbox As String
sConnection = objDataLink.PromptNew
' *** Copy to the clipboard
Clipboard.Clear
Clipboard.SetText sConnection, vbCFText
' *** Copy done
sMsgbox = sConnection & Chr$(13) & "has been copied to the clipboard." & Chr$(13)
sMsgbox = sMsgbox & "You can paste it in your code."
Call MsgBox(sMsgbox, vbOKOnly + vbInformation, "ADO Connection String Creator")
EXIT_CreateNewADOConnection:
Exit Sub
' #VBIDEUtilsERROR#
ERROR_CreateNewADOConnection:
Resume EXIT_CreateNewADOConnection
End Sub