DSNLess Connection and Table Updates

M

MChrist

I'm using the following code chunk to add a table to my db without a DSN
connection. The problem I'm having is that I can not edit/add/delete records
to the table.

I know that the permissions on the MS SQL db backend are checked for the
SELECT, INSERT, UPDATE, DELETE rights.

Any idea of what I'm missing.

Thanks

Mark
 
V

Van T. Dinh

Do you have PK define on each Table on the MS SQL Server?

Also, I find a TimeStamp Field on each Table will eliminate lots of problems
using MS SQL Server Tables as ODBC-linked Tables in Access.
 
M

MChrist

Van,

Thanks for your response. No the table that I'm having troubles with does
not have a primary key defined. Is there a way of handling this without
adding an ID field in on the MS SQL Server?

Mark
 
V

Van T. Dinh

The lack of PK is the problem. IIRC, some earlier posts mentioned that you
can define a (local) unique index in Access for the linked Table. The Link
Table Manager in Access actually offers this when you link the ODBC Tables
using DSN.

I am not sure how to handle this using DSNLess. Since I always have a PK +
TimeStamp Field in each MS SQL Table, I didn't take notice of how to create
a (local) unique index on the linked Table either.

You may want to use the Google Group Search to search for relevant posts in
these newsgroups.
 
D

Duane Hookom

You can generally create the pseudo index using a data definition query

CREATE UNIQUE INDEX PrimaryKey ON tblYourTable (YourFieldName)
 
Top