473,406 Members | 2,816 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

run time error -2147467259(80004005)-

I am trying to run the following code :-----
Expand|Select|Wrap|Line Numbers
  1. Public Function Fill() As Variant
  2. Dim reccheck As ADODB.Recordset
  3. Dim fldcheck As ADODB.Field
  4. Set reccheck = New ADODB.Recordset
  5. Set reccheck.ActiveConnection = CurrentProject.Connection
  6. Dim str As String
  7. str = Format(curdate.Value, "dd/mmm/yy")
  8. reccheck.Source = "work_details"
  9. reccheck.Open "select tslot2 from work_details where emp_id=" & Text13.Value & " and current_date = " & str & "; "
  10. reccheck.MoveFirst
I am getting the following erroe:----run time error -2147467259(80004005)-Method 'Open' of object _recordset failed

Can any body help me????
Jan 1 '08 #1
1 7544
puppydogbuddy
1,923 Expert 1GB
I am trying to run the following code :-----

Public Function Fill() As Variant
Dim reccheck As ADODB.Recordset
Dim fldcheck As ADODB.Field
Set reccheck = New ADODB.Recordset
Set reccheck.ActiveConnection = CurrentProject.Connection
Dim str As String
str = Format(curdate.Value, "dd/mmm/yy")
reccheck.Source = "work_details"
reccheck.Open "select tslot2 from work_details where emp_id=" & Text13.Value & " and current_date = " & str & "; "
reccheck.MoveFirst

I am getting the following erroe:----run time error -2147467259(80004005)-Method 'Open' of object _recordset failed

Can any body help me????

See if this syntax works. This syntax is based on the ADO example at this link: http://allenbrowne.com/func-ADO.html


Expand|Select|Wrap|Line Numbers
  1. Public Function Fill() As Variant
  2.  
  3. 'Declarations
  4. Dim reccheck As ADODB.Recordset
  5. Dim fldcheck As ADODB.Field
  6.  
  7. 'Obtain a criterion for WHERE clause, and
  8. 'construct Select statement
  9.  
  10. Dim str As String
  11. str = Format(curdate.Value, "dd/mmm/yy")
  12. str = "select tslot2 from work_details where emp_id=" & Text13.Value & " and current_date = " & str & "; "
  13.  
  14. 'open the recordset
  15. Set reccheck = New ADODB.Recordset
  16. reccheck.Open str, CurrentProject.Connection
  17.  
  18. 'Loop through recordset until EOF
  19. Do While Not reccheck.EOF
  20.     Debug.Print reccheck!tslot2 & ";" & reccheck!emp_id & ";" & reccheck(str) 
  21.     reccheck.MoveNext
  22. Loop
  23.  
  24. 'Clean up objects and links
  25. reccheck.Close
  26. Set reccheck = Nothing
Jan 1 '08 #2

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

Similar topics

2
by: paul tomlinson | last post by:
Hi folks - i've got a windows 2000 server (SP3) i've run the IIS lockdown tool on it and set for dynamic websites - all the static pages within the site work ok but an ASP section has been put in...
12
by: Grahammer | last post by:
For some reason I am getting an error when trying to open a recordset on an Access database on my Win2K3 machine from my INDEX.ASP page, but the same code accesses the database fine when coming...
1
by: John Dove | last post by:
This post is directly related to MS Knowledge Base Article 306269, "Error 80004005 The MS Jet Database Engine Cannot Open the File" - - This is the precise error I'm getting on a new Login .asp...
2
by: Alex Vidal | last post by:
Hi, I have windows 2000 server with IIS and I program ASP. I use the string: "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=basedatos.mdb;" to data base Access and it always works ok. But I...
15
by: M P | last post by:
What does this mean? I am accessing an ASP page that queries Access Database thru fileDSN. I'm using IIS 5.0 Win2K SP4 Microsoft OLE DB Provider for ODBC Drivers error '80004005' General...
2
by: sunj | last post by:
My database completely works in Dreamweaver MX at a local testing level, but as soon as I upload and access my web pages remotely I get this error on the browser. Can anyone help?...
1
by: Kisa | last post by:
I am using Visual Studio 2005 on Windows Server 2003 (Virtual Server). All service packs are installed. I first had this problem when trying to distribute an application for testing so I then...
0
by: askzda | last post by:
Hi, Can somebody pls help to solve above problem. I have used dundas mailer for my mailing part in my asp script, but the an error occured during sending the mail. Error that is prompted out just...
8
by: ConfusedDeuce | last post by:
Hello Group, I need some help in the worst way. I had a program/database I was working on a particular machine. I took all the data from there and placed it on a another machine. Now I'm unable...
10
Fary4u
by: Fary4u | last post by:
Hi any body know's where is the problem in following code ? it's so simple but can't figer it out ? giving this error ? Microsoft JET Database Engine error '80004005' Cannot open database ''....
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
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...

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.