dbTalk Databases Forums  

ADODB, access2007, open recordset error

comp.databases.ms-access comp.databases.ms-access


Discuss ADODB, access2007, open recordset error in the comp.databases.ms-access forum.



Reply
 
Thread Tools Display Modes
  #11  
Old   
Bob Barrows
 
Posts: n/a

Default Re: ADODB, access2007, open recordset error - 08-25-2011 , 10:56 AM






Roger wrote:
Quote:
On Aug 25, 7:43 am, "Bob Barrows" <reb01... (AT) NOyahooSPAM (DOT) com> wrote:
Bob Barrows wrote:
sSQL="SELECT handoverId,lineNbr " & _
"FROM tblSlsDetail WHERE 1 = 2"

Of course, you should substitute the actual name of the table in sql
server rather than using the name of the linked table (if different).

in this case the original error message is misleading and incorrect

I debug.printed all the fields in the recordset and tried to create
the record manually
turns out one of the actual fields that I was updating has a foreign
key to a product table, and it was missing a record

the manual entry gave me the correct error message, and I fixed the
data
Still, you should fix your routine. There's really no need to recreate open
your recordset inside the loop - highly inefficient.
Open the recordset once: outside the loop. Then close it after the loop
finishes.

Reply With Quote
  #12  
Old   
Tony Toews
 
Posts: n/a

Default Re: ADODB, access2007, open recordset error - 08-25-2011 , 03:31 PM






On Thu, 25 Aug 2011 05:00:52 -0700 (PDT), Roger
<lesperancer (AT) natpro (DOT) com> wrote:

Quote:
as to an insert statement, it's a idea, but the example I've provided
highly simplifies the fields that are updated - actually there are
many fields and the contents is sometimes based on conditions - but
I'll look into an INSERT
I frequently will build my inserts as two strings. One for the fields
and one for the values but a field or two at a time. I think I have
one routine which is around a thousand lines long whose only job is to
do an update/insert from the very complex form to the transactions
table.

Tony
--
Tony Toews, Microsoft Access MVP
Tony's Main MS Access pages - http://www.granite.ab.ca/accsmstr.htm
Tony's Microsoft Access Blog - http://msmvps.com/blogs/access/
For a convenient utility to keep your users FEs and other files
updated see http://www.autofeupdater.com/

Reply With Quote
  #13  
Old   
David-W-Fenton
 
Posts: n/a

Default Re: ADODB, access2007, open recordset error - 08-26-2011 , 03:58 PM



"Bob Barrows" <reb01501 (AT) NOSPAMyahoo (DOT) com> wrote in
news:j34iqr$lbh$1 (AT) dont-email (DOT) me:

Quote:
I would expect he wants to open an empty recordset with the
intention of doing nothing but add new records. Of course,
executing a sql INSERT statement directly would be a better plan.
Or opening an append-only recordset if he needs to see the data
while he's doing the inserts...

--
David W. Fenton http://www.dfenton.com/
contact via website only http://www.dfenton.com/DFA/

Reply With Quote
  #14  
Old   
David-W-Fenton
 
Posts: n/a

Default Re: ADODB, access2007, open recordset error - 08-26-2011 , 03:59 PM



Roger <lesperancer (AT) natpro (DOT) com> wrote in
news:4054a13f-0f45-4c2f-845e-7695ff1b4495 (AT) g31g2000yqh (DOT) googlegroups.co
m:

Quote:
the ADO version worked fine until yesterday

we are in the process of updating from office2007 to office2010,
except for access which will stay at 2007

when we did the update on the development server, this MDB failed
with an ADO issue
looks like the msado15.dll was updated by the office2010 update to
a version incompatible with access2007
Check if you're running Win7 SP1 on the development machine. If so,
you could be having ADO problems.

--
David W. Fenton http://www.dfenton.com/
contact via website only http://www.dfenton.com/DFA/

Reply With Quote
  #15  
Old   
Roger
 
Posts: n/a

Default Re: ADODB, access2007, open recordset error - 08-30-2011 , 05:12 AM



On Aug 25, 9:08*am, Roger <lesperan... (AT) natpro (DOT) com> wrote:
Quote:
On Aug 25, 7:43*am, "Bob Barrows" <reb01... (AT) NOyahooSPAM (DOT) com> wrote:

Bob Barrows wrote:
sSQL="SELECT handoverId,lineNbr *" & _
"FROM tblSlsDetail WHERE 1 = 2"

Of course, you should substitute the actual name of the table in sql server
rather than using the name of the linked table (if different).

in this case the original error message is misleading and incorrect

I debug.printed all the fields in the recordset and tried to create
the record manually
turns out one of the actual fields that I was updating has a foreign
key to a product table, and it was missing a record

the manual entry gave me the correct error message, and I fixed the
data
another issue we found with ADO, occurs when you have access2007/
office2003 and you upgrade the rest of ms-office to 2010

this upgrade installs a newer version of ado15.dll causing ado not to
work with access2007

the fix is to open access2007, under options, select resources and run
'microsoft office diagnostics'

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.