MS Access to SQL server connection string

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • rcsmith0712
    New Member
    • Jun 2020
    • 5

    MS Access to SQL server connection string

    Hi Folks. I have an access application that is using SQL server 2019 for the backend. All of my "queries" work but when the Update and insert statements execute Access will display the append or Update warning but nothing is actually being written or changed in the SQL tables. I believe I need to establish a SQLOLEDB connection string in my access project but I am having trouble. I get a message the states "Object Required". Any assistance would be greatly appreciated. Thank you. So far my code for the connection looks like this:
    Code:
    Dim ConnStr As String
    
    ConnStr = "Provider=SQLOLEDB;Data Source='FalconXtreme';" & _
     "Initial Catalog='SacDb';Integrated Security= TRUE;"
    
     objConn.Open ConnStr
    Last edited by NeoPa; Jun 14 '21, 07:40 PM.
  • NeoPa
    Recognized Expert Moderator MVP
    • Oct 2006
    • 32666

    #2
    So, from your description it's clear you're doing something wrong. What that might be is very hard to tell from the information you share. Your queries work without working :-S

    Do you actually have a connection to the SQL Server in any way that allows updating of data? What are the queries working with? Don't leave us trying to guess what should be in your question.
    Last edited by NeoPa; Jun 15 '21, 02:13 PM.

    Comment

    • isladogs
      Recognized Expert Moderator Contributor
      • Jul 2007
      • 483

      #3
      Following on from NeoPa's comments, please show an example of the code used in your update and insert SQL statements

      Comment

      • hilmi123
        New Member
        • Jun 2021
        • 5

        #4
        Can you share your execution of the sql statement?

        For access front and sql be, you need to change your code for execution for delete, update and insert to "dbSeeChang es"

        Eg

        Code:
        CurrentDb.Execute sql, dbSeeChanges

        Comment

        • NeoPa
          Recognized Expert Moderator MVP
          • Oct 2006
          • 32666

          #5
          Originally posted by Hilmi123
          Hilmi123:
          For access front and sql be, you need to change your code for execution for delete, update and insert to "dbSeeChang es"
          That's very true. Worth a try if you haven't already.

          Comment

          Working...