Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1463
  • Last Modified:

data provider could not be initialized

I've been having problems in Access 2003, which I use as front-end connection to a SQL 2005 server, with the following error message  - "Data provider could not be initialized". The message pops up every  few hours. I tried to catch it On Error events in all forms in my project, and sequentially suppress it.  This did not work, I mean, the error is not caught on this event.

I also tried to tune up SQL server settings connected to a new feature in SQL 2005 to poll, discover, and clean up disconnected sessions (http://social.msdn.microsoft.com/forums/en-US/sqldataaccess/thread/47d2df0a-0f32-41f8-a5b2-6d8d656d3271/ ). Although It seems that I receive now  fewer error messages, it did not solve the problem. Two other threads here were not helpful:
http://www.experts-exchange.com/Microsoft/Development/MS_Access/Access_Forms/Q_23925257.html 
http://www.experts-exchange.com/Microsoft/Development/MS_Access/Access_Forms/Q_23256341.html
0
aryef
Asked:
aryef
  • 4
  • 4
1 Solution
 
alexfariasCommented:
maybe is a MDAC issue...try to reinstall it
0
 
alexfariasCommented:
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
alexfariasCommented:
so I read the second answer, it seems that has to do with permissions ... try it too, check the permissions in the database
0
 
aryefAuthor Commented:
No,... the application works correctly all of the time, I have access to all db resources I need. The pop-up message suddenly pops up after a long inactivity period, usually more than one hour. So, it could not be any permission/security or MDAC issue. The user that access the MS SQL is granted  dbo permissions on the database.  It could not be also an  IIS issue, for I do not use it. I use direct  ADO connection to DB  im my VBA code.  Sample code is
Set conn = New ADODB.Connection
    conn.ConnectionString = "some valid connection string"
    conn.Open
    Set cmd = New ADODB.Command
With cmd
   .ActiveConnection = conn
   .CommandTimeout = 5
   .CommandText = strCommandText
   .CommandType = adCmdStoredProc
End With

Set rst = New ADODB.Recordset
    rst.Open cmd
If Not rst.State = adStateClosed Then
   If Not rst.EOF Then
 
    Retval = rst.GetString(adClipString, , DELIM, DELIM)
   End If
End If
0
 
aryefAuthor Commented:
Now I am trying to use "Launch Depends..." of Sysinternals Process Explorer, to try to find out where this message is thrown. As I said, it is not caught at "OnError" or "OnCurrent" event in any form in my project.
I'll post if I find something interesting there...
0
 
aryefAuthor Commented:
First of all, the error message is 100% reproducible by choosing the "refresh" item of the "records" menu of Access Menu bar. it has no apparent consequence, for after its appearing, the application works as fine as it should.
It was not possible to catch the message neither at OnError event of the Form not at OnCurrent.

OK, I tried to bind the main form of my project to just a regular Access table, instead of ADO recordset. As a result, the error message ("data provider coudl not  be initialized") was incurred as many times as it takes of refreshing the each and every subform of my main form!  Instead of appearing once, I had 13 uch appearances when choosing the "refresh".

So, I rebound the main form back to its ADO recordset. Now, I again receive the message only once, when I choose the "refresh" item of the "Records" menu.

If someone now what event fires up on clicking the "refresh" item of the "records" menu, this will probably solve this very strange problem..
??
0
 
aryefAuthor Commented:
I did the following experiment - I run the application within a VMware Player box. VMWare Player has a very interesting feature - when you restore it from a minimized state, or just click within, it does not incur any repaint or screen refresh events in MS Access applications. And, as a result, no "Data provider...." message ever appears after an inactivity period. Only if I specifically choose "Records" -> "Refresh" menu item, it happens, but it seems to be not a problem, becuae no one will need to do it on purpose.
Quite a strange "solution"... Doe anyone know how to mimic this behavior (skip all repaint events)  in regular, not virtualized, evnvironment??
0
 
ee_autoCommented:
Question PAQ'd, 500 points refunded, and stored in the solution database.
0

Featured Post

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

  • 4
  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now