access linked to sql

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

I have an access program the database is done trough linked tables to sql

Now i have a code that used to work for access database however it does not work through the linked tables to sql

code is ike thi
Dim db As DAO.Databas


Set db = CurrentD

db.Execute "UPDATE trailer SET locatie = 'Belgie' WHERE trailernr = '" & Me.trailer & "'", dbFailOnErro
db.Execute "UPDATE trailer SET datum = '" & Me.ARRIVAL & "' WHERE trailernr = '" & Me.trailer & "'", dbFailOnErro
MsgBox trailer & " terug uit GB " & db.RecordsAffected & " .

can anyone tell me what i shoul do to make this work on linked odbc tables in sql

thanks in advanc
Miguel
 
miguel said:
Hi,

I have an access program the database is done trough linked tables to sql

Now i have a code that used to work for access database however it does
not work through the linked tables to sql [snip]

Please elaborate on "...does not work...".

Do you get an error?

Are the links editable manually?
 
and I can change the tables contents manually through the linked tables in acces
My guess is that the connection to the database will probably have to go directely to sql
but i haven't got a clue on how to do that
 
miguel said:
and I can change the tables contents manually through the linked tables in access
My guess is that the connection to the database will probably have to go directely to sql
but i haven't got a clue on how to do that

If the link is editable manually you should be able to anything with them
in code that you can do with a local table. This is not always the
"optimal" way to deal with an ODBC datasource, but it should work. I can't
imagine the updates not occurring and an error not being raised.

I do this stuff all the time by the way, and can see nothing wrong with
your code.
 
auch,

I feel stupi

it does make the changes in the database
however i have a messagebox that shows how many records are affected
and it shows that 0 records are affected
main thing is that it does what i want it to d

thanks for helping
Migue
 
Back
Top