473,626 Members | 3,427 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Data provider could not be initialized error help

1 New Member
I am trying to debug a VBA program in Access and have no idea what I am doing, but when I execute the code I get the following error:
"Data provider could not be initialized"

The debugger sends me to the "Set conn = CurrentProject. AccessConnectio n" in the code below which I searched help for and found that current project is one of the properties in Access 2007 that is blocked by sandbox mode. So I followed the instructions and changed the sandbox number in the registry from 3 to 2, but still the same error. I also made sure to add the file path to the trusted locations. I might be leading down the wrong path altogether, but this works on other machines and not mine making me think it is a security setting.
Anyhow, any help would be much appreciated.

Expand|Select|Wrap|Line Numbers
  1. Dim rs As DAO.Recordset, rs1 As DAO.Recordset
  2. Set rs = CurrentDb.OpenRecordset("SELECT count(litter), litter, pad_name FROM tpl_Efficiency_Output GROUP BY pad_name, litter")
  3. Dim exeStr As String
  4. Dim conn As New ADODB.Connection
  5. Set conn = CurrentProject.AccessConnection
  6.  
  7. Do Until rs.EOF
  8.     If rs(0) <= 2 Then
  9.         If rs(1) > 1 Then
  10.             exeStr = "update tpl_Efficiency_Output set Litter="
  11.             exeStr = exeStr & rs(1) - 1
  12.             exeStr = exeStr & "  where pad_name="
  13.             exeStr = exeStr & "'" & rs(2) & "'"
  14.             exeStr = exeStr & " and Litter=" & rs(1)
  15.             conn.Execute (exeStr)
  16.         End If
  17.     End If
  18.     rs.MoveNext
  19. Loop
  20. rs.Close
  21.  
  22. End Sub
Jul 13 '10 #1
1 5711
MikeTheBike
639 Recognized Expert Contributor
@JulieV
Hi

Have you tried this instead

Set conn = CurrentProject. Connection

I assume this hasn't changed in Access 2007

??

MTB
Jul 14 '10 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
3738
by: Marsha | last post by:
Does anyone know how to add a new data provider to Visual Studio - to the Provider list in Server Explorer. I am using Sybase's ADO.NET Data Provider. It has been added to my GAC and appears in my References. However, I would like to add the provider to the Provider list in Server Explorer. Thanks. ~Marsha
2
5613
by: rufus | last post by:
Hi, My vb.Net program is copy files from one network location to another, because these are quite large files it takes hrs and i keep getting a timeout expired error message from the the data provider prior to completion. Can anybody help? Thank you
10
2180
by: Paul Deibel | last post by:
Hello I am working on a VB.Net project where I need to change the data provider from OLEDB to OracleClient. I am also looking to use "shaping" and I am looking for the equivalent to "Provider=MSDataShape.1" when using an OracleClient connection string. The provider syntax works fine with an OLEDB Connection String. Does anyone know how to do this? I am using the 1.1 framework, and Visual Studio vb.net (Note ... I switched to...
0
1664
by: acwomble | last post by:
I am working with a database on another system via a ssh tunnel using plink. We have setup an alias the local system for the remote database. I am able to connect and work from within Visual Studio if I connect to the remote database using with "SQL Server" as the data source and ".NET Framework Data Provider for OLEDB" as the data provider . If I change the data provider to ".NET Framework Data Provider for SQL Server" I get the...
2
8123
by: Andrew | last post by:
Win2k3 IIS6 ..NET 2.0 In my ASP.NET 2.0 app I create an open an SQL connection in the page's constructor and call objSQL.Dispose() in the destructor. The SQLConnection object is a class member of the page. Here's the destructor code: /// Destructor ~Officer()
6
1175
by: Bonzol | last post by:
Can someone tell me why I get this error "An unhandled exception of type 'System.Data.OleDb.OleDbException' occurred in system.data.dll" when i do this Private Sub btnAdd_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnAdd.Click
1
5177
by: John Bailo | last post by:
I'm doing a profile on my SQL Server to see if I can eliminate any long running statements, and periodically, I see an entry for ".NET SqlClient Data Provider". The durations for it are very long, the example below shows 386 seconds! I would think that whatever these are they are "gumming up" my database server. However, there is nothing in the Text Data field to help me identify the source! Does anyone else get this showing up...
2
13750
by: Bob | last post by:
I'm running sql server ver 7.0 SP4. I have an access project (.adp) that runs a view which is nothing more than a select statement. Access locks up solid when I try to run this query - with NO error messages what-so-ever. If I sign onto the server, and run the view from enterprise manager - I get: "the data provider or other service returned an E_FAIL status" !?!?! There is NO ERROR number, or further explanation of the message!!
2
6101
by: Klaudiusz Bryja | last post by:
Hi I connect to Oracle 9.2 using System.Data.OracleClient. I call stored procedures and in cmd.ExecuteNonQuery I get error: "Internal .Net Framework Data Provider Error 30." StackTrace: in System.Data.ProviderBase.DbBuffer.Validate(Int32 offset, Int32 count)
0
8713
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8644
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
7206
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6126
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5579
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4094
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4208
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1817
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1516
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.