Results 1 to 5 of 5

Thread: Access 2003 DAO Connections

  1. #1

    Thread Starter
    Lively Member
    Join Date
    May 2002
    Posts
    107

    Access 2003 DAO Connections

    Hi,

    I'm using Access to create some reports that use tables linked to SQL database. I'm prompted for a SQL password every time I run a query or report and wanted to automatically assign the UID and Password so the user doesn't have to enter a password. I've played around with this code but I think I need DAO commands?

    Can someone tell me how to change this ADO command into DAO command

    Set cnAptify = New ADODB.Connection
    With cnAptify
    .ConnectionString = "DSN=DevAp;UID=sa;PWD=P123;"
    .Open
    End With


    Thanks much.

  2. #2
    Software Carpenter dee-u's Avatar
    Join Date
    Feb 2005
    Location
    Pinas
    Posts
    11,127
    Regards,


    As a gesture of gratitude please consider rating helpful posts. c",)

    Some stuffs: Mouse Hotkey | Compress file using SQL Server! | WPF - Rounded Combobox | WPF - Notify Icon and Balloon | NetVerser - a WPF chatting system

  3. #3
    Frenzied Member
    Join Date
    May 2006
    Location
    some place in the cloud
    Posts
    1,886

    Re: Access 2003 DAO Connections

    I use the next ADO code without problems
    Code:
    Dim MiConStr1 As String
        MiConStr1 = "Provider=SQLOLEDB.1;" & _
                     "UID=MyUserName;" & _
                     "PWD=MyPassword;" & _
                     "Persist Security Info=False;" & _
                     "Initial Catalog=DBName;" & _
                     "Data Source=ServerName"
    
        Set MiSQL1 = New ADODB.Connection
            MiSQL1.CursorLocation = adUseClient
            MiSQL1.ConnectionString = MiConStr1
            MiSQL1.Open

  4. #4
    Software Carpenter dee-u's Avatar
    Join Date
    Feb 2005
    Location
    Pinas
    Posts
    11,127

    Re: Access 2003 DAO Connections

    Quote Originally Posted by jggtz
    I use the next ADO code without problems
    Code:
    Dim MiConStr1 As String
        MiConStr1 = "Provider=SQLOLEDB.1;" & _
                     "UID=MyUserName;" & _
                     "PWD=MyPassword;" & _
                     "Persist Security Info=False;" & _
                     "Initial Catalog=DBName;" & _
                     "Data Source=ServerName"
    
        Set MiSQL1 = New ADODB.Connection
            MiSQL1.CursorLocation = adUseClient
            MiSQL1.ConnectionString = MiConStr1
            MiSQL1.Open
    The OP wants DAO.
    Regards,


    As a gesture of gratitude please consider rating helpful posts. c",)

    Some stuffs: Mouse Hotkey | Compress file using SQL Server! | WPF - Rounded Combobox | WPF - Notify Icon and Balloon | NetVerser - a WPF chatting system

  5. #5
    Frenzied Member
    Join Date
    May 2006
    Location
    some place in the cloud
    Posts
    1,886

    Re: Access 2003 DAO Connections

    The OP wants DAO
    Yes I know, but He wants DAO because he has problems with ADO
    I think it's better to first try to resolve the problem using ADO instead of change to DAO

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