Everytime I open my Access database it throws up a "SQL Server Login" need help

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • anoble1
    New Member
    • Jul 2008
    • 246

    #1

    Everytime I open my Access database it throws up a "SQL Server Login" need help

    Hi,

    I recently upgraded 2 of the servers on my MS Access 2007 database. A UA server and a Production server. WHen I converted over to the new severs I just changed the names in code. Also, I had to relink all the tables to the new server. I had to create a DSN. I got all the tables linked.

    Well, now whenever I open the database it has the SQL Server Login screen, with a username and password. Why does that come up now?

    So, I have to enter my SQL Server password to login to the DB. Any help? ANyone had this happen?

    Below is the code from my code ModLink.

    Code:
    Public Function PingTRIPSDatabaseITUAServer()
        Dim connectString As String
        'connectString = "ODBC;Driver={SQL Server};Server=GAXGPSQ05UA;Database=TRIPS;UID=trimsuser;pwd=trimsdata"
        connectString = "ODBC;Driver={SQL Server};Server=GAXGPSQ81UA;Database=TRIPS;UID=trimsuser;pwd=trimsdata"
        Set db = DBEngine.OpenDatabase("", False, True, connectString)
    End Function
    
    Public Function PingTRIPSDatabaseITProductionServer()
        Dim connectString As String
        'connectString = "ODBC;Driver={SQL Server};Server=GAXGPSQ09;Database=TRIPS;UID=trimsuser;pwd=nat10nal"
        connectString = "ODBC;Driver={SQL Server};Server=GAXGPSQ82;Database=TRIPS;UID=trimsuser;pwd=nat10nal"
        Set db = DBEngine.OpenDatabase("", False, True, connectString)
    End Function
    
    Public Sub LinkTripsTablesUAITServer(table As String)
    
    '    cn = "odbc;driver={SQL Server};server=GAXGPSQ05UA;database=TRIPS;uid=trimsuser;pwd=trimsdata"
        cn = "odbc;driver={SQL Server};server=GAXGPSQ81UA;database=TRIPS;uid=trimsuser;pwd=trimsdata"
        
        Set db = CurrentDb
        Set td = db.CreateTableDef()
        td.Name = table
        td.SourceTableName = "dbo." & table
        td.Connect = cn
        
        Set tds = db.TableDefs
        tds.Append td
    
    End Sub
    
    Public Sub LinkTripsTablesProductionITServer(table As String)
    
        'cn = "odbc;driver={SQL Server};server=GAXGPSQ09;database=TRIPS;uid=trimsuser;pwd=nat10nal"
        cn = "odbc;driver={SQL Server};server=GAXGPSQ82;database=TRIPS;uid=trimsuser;pwd=nat10nal"
        
        Set db = CurrentDb
        Set td = db.CreateTableDef()
        td.Name = table
        td.SourceTableName = "dbo." & table
        td.Connect = cn
        
        Set tds = db.TableDefs
        tds.Append td
    
    End Sub
    [imgnothumb]http://bytes.com/attachments/attachment/6234d1331962118/microsoft-access-trips-database-access-2007-_2012-03-17_00-28-05.jpg[/imgnothumb]
    Attached Files
    Last edited by NeoPa; Mar 17 '12, 07:49 PM. Reason: Made pic viewable.
  • ADezii
    Recognized Expert Expert
    • Apr 2006
    • 8834

    #2
    Can you use Trusted_Connect =True within the Connection String to use Windows Authentication?

    Comment

    Working...