I don't know if it's the same, but you can use the DataLink library, it
allows you to build oledb connection strings.
How do I show the same windows dialog for selecting a DSN as does windows in
ODBC Sources?
That would be the window titled
"ODBC Data sources administrator"
-Lou
Lou - 19 Dec 2006 16:20 GMT
Perfect, that worked great.
Thanks..
Found this simple code..
'John B
'VB Programmer
'zippity@leading.net
'******************
'YOU NEED:
'VB 6 with:
'Reference Setting checked - "Microsoft OLE DB Service Component
'1.0 Type Library"
'Reference Setting checked - "Microsoft ActiveX
'Data Objects 2.0 Library"
'******************
'http://www.freevbcode.com/ShowCode.Asp?ID=453
'STEPS:
'(1)Create EXE project
'(2)Place a long TextBox control named "txtconstr" on form
'[this is your ADO string]
'(3)Place a CommandButton called "cmdNew" on form
'(4)Place a second CommandButton called "cmdEdit" on form
'(5) Insert this code [new]
Private Sub cmdNew_Click()
On Error GoTo ERRORHANDLER
Dim objDataLink As New DataLinks
Dim strConn As String
strConn = objDataLink.PromptNew
txtconstr.Text = strConn
Exit Sub
ERRORHANDLER:
txtconstr.Text = ""
End Sub
'(6)Insert this code [edit]
Private Sub cmdEdit_Click()
On Error GoTo ERRORHANDLER
Dim objDataLink As New DataLinks
Dim ADOCN As New ADODB.Connection
Dim strConn As String
ADOCN.ConnectionString = txtconstr.Text
strConn = objDataLink.PromptEdit(ADOCN)
txtconstr.Text = ADOCN.ConnectionString
Exit Sub
ERRORHANDLER:
MsgBox "An invalid ADO ConnectionString was detected. Please try
again!"
txtconstr.Text = ""
End Sub
>I don't know if it's the same, but you can use the DataLink library, it
> allows you to build oledb connection strings.
[quoted text clipped - 6 lines]
>
> -Lou