Question : ODBC--update on a linked table '<TABLE NAME>' failed.

this is an Access97 front end with ODBC linked tables to SQL 2000

the table itself is editable, but my vba code gives the error "ODBC--update on a linked table 'ALA_MAGINV' failed." (nothing else in the error message)

here is the query:

        gstrSQL = "SELECT * FROM [ALA_MAGINV] WHERE ([Active] = True) AND ([ALA_InclPriceList] = True) ORDER BY [Akey];"
        Set rsALA_MAGINV = CurrentDb.OpenRecordset(gstrSQL, dbOpenDynaset, dbSeeChanges)
        ' code here opens another recordset that calculates a currency variable
        rsALA_MAGINV.Edit
        rsALA_MAGINV![Cost] = curLeastCost
        rsALA_MAGINV.Update

it breaks on the Update

[Akey] is a PK string


if my SQL string looks like the following, it doesn't break:

"SELECT [Akey], [Cost] FROM [ALA_MAGINV] WHERE ([Active] = True) AND ([ALA_InclPriceList] = True) ORDER BY [Akey];"

isn't there a way i can use "SELECT * FROM..." in my recordset definitions?
thanks,
mac

Answer : ODBC--update on a linked table '<TABLE NAME>' failed.

Are there a prohibitive number of fields to list them all?
I mean if you create a query that lists every field explicitly.
(In a query builder just select them all and drag).
Then try it with that.

If it fails on that - then it could perhaps just be one of the fields (included in the *) that is causing it to fail, not the presence of the * itself.
Perhaps a field type that Access doesn't like?
Random Solutions  
 
programming4us programming4us