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...
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.
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
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:
Dim lRecs As Long
Access.CurrentDb.Connection.Execute "INSERT INTO Table1 VALUES('Testing')", lRecs
MsgBox lRecs & " records added", vbOKOnly + vbInformation