PHP User Warning: fetch_template() calls should be replaced by the vB_Template class. Template name: bbcode_highlight in ..../includes/functions.php on line 4197
RUNTIME ERROR '3146'..ODBC-Call Failed-VBForums
Results 1 to 4 of 4
  1. #1

    Thread Starter
    Hyperactive Member nagasrikanth's Avatar
    Join Date
    Nov 2004
    Location
    India,Hyderabad.
    Posts
    420

    Lightbulb RUNTIME ERROR '3146'..ODBC-Call Failed

    Hi..

    Im using SQL server as my backend and MS Access as F.E..

    Im using to update around 10 to 20 records one by one by upto 2 to 3 records it was updating, later for 4th record it was saying "RUNTIME ERROR '3146'..ODBC-Call Failed"(at "rst.update" it was showing)
    ..at that time if i start agian from "rst.addnew" then for upto 3 to 4 it was okay..Is there any limitation in adding records.???
    FYI: Im not getting if i update 1 or 2 records..and
    one more thing that i came to know was ,If the table was a ordinary Access Table..Im not getting any error..
    One more thing was If i place some time delay using msgbox (like msgbox "Updated..." for example)that means for each record I placed a message updated..then it was working perfectly on to my surprise..


    Please help me in this regard..Please..

    Thanks & regards
    Anu...

  2. #2
    Super Moderator RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,555

    Re: RUNTIME ERROR '3146'..ODBC-Call Failed

    Sounds like your updating/adding records through Access tables/queries and not directly to the SQL tables? Alos, probably
    using a recordset to add/update when you could execute a sql INSERT statement or an sql UPDATE statement.

    Recordsets are slow. You can create a connection to SQL using ADO, DAO, ODBC to perform your actions.
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Star Wars Gangsta Rap Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Corsair H100i v2 water cooler, Geforce GTX1060, Samsung M.2 500 GB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2010, VS 2010

  3. #3

    Thread Starter
    Hyperactive Member nagasrikanth's Avatar
    Join Date
    Nov 2004
    Location
    India,Hyderabad.
    Posts
    420

    Lightbulb Re: RUNTIME ERROR '3146'..ODBC-Call Failed

    Hi Rob,
    Thanx for u r quick reply..
    But Im using SQL tables it self,(Sql tables are linked in my database..)
    and whenever i want to insert new records im opening a connection using
    set rst=currentdb.openrecordset(sql string.......)
    and im inserting a new row by using AddNew and Update methods (not by using sql Queries)

    What i have to do speed up my recordset..Please help..

    Thanx & Regards
    Srikanth

  4. #4
    Super Moderator RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,555

    Re: RUNTIME ERROR '3146'..ODBC-Call Failed

    The slowness is from Access having to connect its linked ODBC connection to your SQL db/table via a rs. You could
    execute a statement like so.

    VB Code:
    1. Dim lRecs As Long
    2.     Access.CurrentDb.Connection.Execute "INSERT INTO Table1 VALUES('Testing')", lRecs
    3.     MsgBox lRecs & " records added", vbOKOnly + vbInformation
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Star Wars Gangsta Rap Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Corsair H100i v2 water cooler, Geforce GTX1060, Samsung M.2 500 GB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2010, VS 2010

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Featured


Click Here to Expand Forum to Full Width