Results 1 to 6 of 6

Thread: ADO connection string form [RESOLVED]

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Jul 2002
    Location
    UK
    Posts
    147

    Resolved ADO connection string form [RESOLVED]

    i am using Carlos J. Quintero's MZ tools 3.0 and there is a function to allow you to build an ADO connection string (see attached)

    Has this form been built by Carlos or is it a control which i can referance in my app?
    Attached Images Attached Images  
    Last edited by mik706; Feb 3rd, 2005 at 08:25 AM.
    Mik706

  2. #2
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901

    Re: ADO connection string form

    Word has one in the MailMerge section, but I think he wrote his own.

  3. #3
    Addicted Member
    Join Date
    Aug 2004
    Posts
    176

    Re: ADO connection string form

    Right click on ADODC. go to ADODC Properties. In General > Use Connection String > Build. You see the same form.

  4. #4

    Thread Starter
    Addicted Member
    Join Date
    Jul 2002
    Location
    UK
    Posts
    147

    Re: ADO connection string form

    flair, i have seen this form which is why i asked if it was a control i could give the user of my app access to at runtime so they can connect the app to a different DB.
    Mik706

  5. #5
    PowerPoster
    Join Date
    Jun 2001
    Location
    Trafalgar, IN
    Posts
    4,141

    Re: ADO connection string form

    You will need to set a reference to "Microsoft OLE DB Service Component 1.0 Type library" and then you can call up the dialog like this.
    VB Code:
    1. Option Explicit
    2.  
    3. Private Sub cmdConn_Click()
    4.     MsgBox BuildConnectionString
    5. End Sub
    6.  
    7. Private Function BuildConnectionString() As String
    8. Dim objLink As MSDASC.DataLinks
    9. Dim strConn As String
    10.  
    11.     On Error Resume Next
    12.    
    13.     '   Display the dialog
    14.     Set objLink = New MSDASC.DataLinks
    15.     strConn = objLink.PromptNew
    16.    
    17.     If Err.Number = 0 Then
    18.         '   Create a Connection object on this connection string
    19.         BuildConnectionString = strConn
    20.     Else
    21.         '   User canceled the operation
    22.         BuildConnectionString = ""
    23.     End If
    24.    
    25.     Set objLink = Nothing
    26. End Function

  6. #6

    Thread Starter
    Addicted Member
    Join Date
    Jul 2002
    Location
    UK
    Posts
    147

    Re: ADO connection string form

    MarkT, cheers that is exactly what i was looking for!
    Mik706

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width