Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem deleting data from a linked table within MS Access linked to SQL Server

Status
Not open for further replies.

malibu65k

Programmer
Sep 27, 2004
131
0
0
US
I've deleted data in a table in SQL Server and set a primary key and saved the table. I went to my MS Access db and linked the table I just deleted the data in from the SQL Server. When I open the table in Access, all the data is still there and the primary key isn't set. I close both the SQL Server and the MS Access db and re-open and link the table again. Still the data is there with no primary key. I go back to SQL server, the table is empty and the primary key is set. Am I crazy? What am I doing wrong?
 
Are you sure it is connecting to where you think?

As it is a linked table, try delting the table in access and then re-adding it as linked.

Does it then correctly show as empty?

It may have accidently been imported rather than linked so you are seing a localised table with the data in it not the linked SQL table?

Just a thought.

"In complete darkness we are all the same, it is only our knowledge and wisdom that separates us, don't let your eyes deceive you."

"If a shortcut was meant to be easy, it wouldn't be a shortcut, it would be the way!"

Free Dance Music Downloads
 
The connection is correct and I've deleted and re-linked several times. Still has the data in it. I even set a field as a primary key in SQL saved it and that field doesn't show as a primary key in Access. But just with this one table.
 
try these two options and come back with the result please.

1 - on the same MDB create a new linked table - give it a different name from what you used so far.
Tell us if it shows the updated data/table definition

2 - on a brand new MDB do same as in point 1

Regards

Frederico Fonseca
SysSoft Integrated Ltd

FAQ219-2884
FAQ181-2886
 
I figured out the problem. It was really stupid on my part. I had 2 DSNs, both used the same username and password that the admin created for me. It's used to access 2 databases on the server. The one was set for a database that I didn't change any of the tables. I changed the default database in the one DSN that I made the changes to and there it was. I need to just delete the other one so I don't get confused.

Thanks all for the suggestions!

 
No probs, gald you worked it out.

As I thought, it seemed as though you weren't pointing to where you thought you were, though it was via a linked DSN and not to a local table!

We all make stupid mistakes, what's important is no one died and you fixed it [thumbsup]

"In complete darkness we are all the same, it is only our knowledge and wisdom that separates us, don't let your eyes deceive you."

"If a shortcut was meant to be easy, it wouldn't be a shortcut, it would be the way!"

Free Dance Music Downloads
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top