468,790 Members | 1,922 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,790 developers. It's quick & easy.

MS Access to SQL server connection string

5 Nibble
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:
Expand|Select|Wrap|Line Numbers
  1. Dim ConnStr As String
  2.  
  3. ConnStr = "Provider=SQLOLEDB;Data Source='FalconXtreme';" & _
  4.  "Initial Catalog='SacDb';Integrated Security= TRUE;"
  5.  
  6.  objConn.Open ConnStr
Jun 14 '21 #1
4 3353
NeoPa
32,132 Expert Mod 16PB
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.
Jun 14 '21 #2
isladogs
277 Expert 256MB
Following on from NeoPa's comments, please show an example of the code used in your update and insert SQL statements
Jun 14 '21 #3
hilmi123
5 Nibble
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 "dbSeeChanges"

Eg

Expand|Select|Wrap|Line Numbers
  1. CurrentDb.Execute sql, dbSeeChanges
Jun 29 '21 #4
NeoPa
32,132 Expert Mod 16PB
Hilmi123:
For access front and sql be, you need to change your code for execution for delete, update and insert to "dbSeeChanges"
That's very true. Worth a try if you haven't already.
Jun 29 '21 #5

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

3 posts views Thread by J. Muenchbourg | last post: by
5 posts views Thread by Fred Zuckerman | last post: by
1 post views Thread by madfisher | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
2 posts views Thread by Marin | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.