Re: Adding records to a SQL 2000 table with an identity field, in Access 2003



When I attempted to reproduce the problem before, I mistakenly used a table
that didn't have any text or ntext fields. When I use a table that does, I
can reproduce the error ...

Set db = CurrentDb
Set rstd = db.OpenRecordset("SELECT * FROM dbo_Employees", ,
dbSeeChanges)
Debug.Print rstd.Fields(0).Value
rstd.Close

This causes the 'must use dbSeeChanges' error, even though I am already
using it. However, explicitly specifying dbOpenDynaset did fix the problem
for me ...

Set db = CurrentDb
Set rstd = db.OpenRecordset("SELECT * FROM dbo_Employees", _
dbOpenDynaset, dbSeeChanges)
Debug.Print rstd.Fields(0).Value
rstd.Close

The above ran without error. I tested both with the SQL statement as above,
and using the table name, with the same result.

--
Brendan Reynolds (MVP)


"Kyle O'Bryan via AccessMonster.com" <forum@xxxxxxxxxxxxxxxxx> wrote in
message news:52896DF9AA1D6@xxxxxxxxxxxxxxxxxxxx
> Already tried setting options manually, same thing. Also, they're linked
> tables so it doesn't o0pen a Table-Type Recordset, it opens a Dynaset.
>
> Tim Ferguson wrote:
>>> I have tried opening a recordset with a SQL statement and I still get
>>> the
>>> same error telling me to supply the dbSeeChanges constant in the options
>>> argument when opening a table with an Identity,
>>>
>>> set rst = CurrentDb.OpenRecordset("ParentTable",,dbSeeChanges)
>>
>>I've never met this error message but I never leave the options blank
>>either. And I never ever ever open table-type dynasets.
>>
>>Try setting all the argements correctly and see if that gets rid of the
>>error message.
>>
>>Best wishes
>>
>>Tim F
>
>
> --
> Message posted via AccessMonster.com
> http://www.accessmonster.com/Uwe/Forums.aspx/access-modules/200508/1


.



Relevant Pages

  • Re: Get Connected Crashes Computer
    ... Susan, have you solved your problem, in that case, what did you do? ... "Peter B" wrote in message ... Unfortunately I cannot reproduce the problem on ... >>>that error message is very useful. ...
    (microsoft.public.pocketpc.activesync)
  • Re: Check for missing field in edit form
    ... I can't reproduce the behaviour you're experiencing. ... on the hyperlink control and follow the menu down to 'edit hyperlink' it ... keeps looping the error message and I cannot continue. ... 'The field is empty ...
    (microsoft.public.access.gettingstarted)
  • Re: Order By - Conditional
    ... I must reproduce your situation on my system. ... Enough sample data to show what you want to achieve, ... are getting from it - if it's an error message, ... A short and concise description of the business problem you're trying ...
    (microsoft.public.sqlserver.mseq)
  • Re: Printing Area Too Small
    ... for using inputbox. ... I can't seem to reproduce it with a simpler version. ... is what could be generating the error message. ... SET ORDER TO WindowID ...
    (microsoft.public.fox.programmer.exchange)
  • Re: Code works in query but not in vba - help
    ... this gives me the error message "Item not found in this selection. ... CurrentDb.Execute strSQL, dbSeeChanges ... That would be better than using RunSQL. ... Bob Hairgrove ...
    (microsoft.public.access.formscoding)