Microsoft Access Forums

Go Back   Microsoft Access Forums > Access Forums > Programming

Reply
 
LinkBack Thread Tools Display Modes
  #1  
Old 10-01-2009, 06:19 AM
HerrSonntag HerrSonntag is offline Windows XP Access 2002 (version 10.0)
Novice
 
Join Date: Sep 2009
Posts: 2
HerrSonntag is on a distinguished road
Default Swapped DAO recordset update with SQL Action Query. Result? Broken.

I recently migrated some backend data from a local access MDB to SQL Server. Because of the use of link tables, the existing ADO style updates were horribly slow.

So I swapped out the code for DAO and reduced the insert time from 11 seconds to less than one.

However, later in the execution, when the VBA code for one of the forms attempts to reference a field within the same form, the txtField.Value renders "You entered and expression that has no value"

In an "all things equal" branch that keeps the ADO there is no such problem.

the code changed from the form:

Code:
Set dbOrgDB = DBEngine.Workspaces(0).Databases(0)
            Set snTbl = dbOrgDB.OpenRecordset(sTable, DB_OPEN_TABLE)
            ....
            snTbl.AddNew
            ...
            snTbl.Update

Code:
Set dbOrgDB = DBEngine.Workspaces(0).Databases(0)
    Set snTbl = dbOrgDB.OpenRecordset(sTable, DB_OPEN_DYNASET) --only used to determine # of fields....

        tempSQL = "INSERT INTO .............."

            CurrentDb.Execute tempSQL
Do I need to "Commit" these executed statements to the local buffer or something?
Reply With Quote
  #2  
Old 10-01-2009, 12:21 PM
HerrSonntag HerrSonntag is offline Windows XP Access 2002 (version 10.0)
Novice
 
Join Date: Sep 2009
Posts: 2
HerrSonntag is on a distinguished road
Default

AND resolved, logic error :-D
Reply With Quote
  #3  
Old 10-01-2009, 01:39 PM
RuralGuy's Avatar
RuralGuy RuralGuy is offline Windows 7 Access 2007 (version 12.0)
Super Moderator
 
Join Date: Mar 2007
Location: 8300' in the Colorado Rocky Mountains
Posts: 3,848
RuralGuy will become famous soon enoughRuralGuy will become famous soon enough
Default

Great! Do you want to go ahead and mark this thread Solved with the thread tool?
__________________
(RG for short) aka Allan Bunch MS Access MVP - WinXP Pro, Win7 - acXP, ac07
If your issue is resolved...follow this link for directions on how to use the Solved thread tool!
Teaching is not filling a bucket but lighting a fire. Borrowed quote..."Docendo discimus"
Reply With Quote
Reply

Bookmarks

Tags
action query, dao

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Controls go blank on empty query result kevdfisch Programming 4 08-25-2009 06:07 AM
Option Group broken out dcecil Reports 3 04-21-2009 08:30 AM
Add new Recordset using Recorset by Query gailoni Programming 1 10-22-2008 09:52 PM
Result of Count Query not known elsewhere Carole Access 1 09-07-2008 07:39 AM
criteria to limit # of characters in a query result. valdense Queries 2 08-04-2008 02:16 PM


All times are GMT -8. The time now is 08:20 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.3.2 ©2009, Crawlability, Inc.