473,395 Members | 1,856 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,395 software developers and data experts.

Find and Update Recordset

5
Hi

I have following code to find the hashvalue in HashValue colunm and update the Time in BST column. But i breaks in (objRecordSet.Fields.Item("BSTime") = Time) here (**Edit Line #23 **). Pls HELP
Expand|Select|Wrap|Line Numbers
  1. Function UploadBST()
  2.  
  3. 'On Error Resume Next
  4. Dim objConnection As ADODB.Connection
  5. Dim objRecordSet As ADODB.Recordset
  6. Dim hashvalue1 As String
  7.  
  8. Set objConnection = CreateObject("ADODB.Connection")
  9. Set objRecordSet = CreateObject("ADODB.Recordset")
  10.  
  11. objConnection.Open _
  12.     "Provider = Microsoft.Jet.OLEDB.4.0; " & _
  13.         "Data Source =C:\Documents and Settings\Owner\My Documents\New.mdb;"
  14.  
  15. objRecordSet.Open "SELECT * FROM TS", _
  16.     objConnection, adOpenStatic, adLockOptimistic
  17.  
  18. hashvalue1 = Environ("Username") & Date
  19. strCriteria = "HashValue = 'hashvalue1'"
  20.  
  21. objRecordSet.Find strCriteria
  22.  
  23. objRecordSet.Fields.Item("BSTime") = Time
  24. objRecordSet.Update
  25.  
  26.  
  27. objRecordSet.Close
  28. objConnection.Close
  29.  
  30.  
  31. End Function
Jul 5 '10 #1
4 2305
ADezii
8,834 Expert 8TB
@Ceylon
Try changing the Cursor Type:
Expand|Select|Wrap|Line Numbers
  1. objRecordSet.Open "SELECT * FROM TS", _
  2. objConnection, adOpenKeyset, adLockOptimistic
Jul 5 '10 #2
NeoPa
32,556 Expert Mod 16PB
Please describe more clearly what you mean by "It breaks". Is there an error message? What happens exactly?

We shouldn't be spending extra time just trying to work out what your question means.
Jul 6 '10 #3
Ceylon
5
Ok, Thanks for the info
Jul 6 '10 #4
Ceylon
5
@ADezii
this worked thanks
Jul 8 '10 #5

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

Similar topics

2
by: Corey | last post by:
I am missing something here. I have a pop up form (loads from the "main form")that displays multiple command buttons. When a user selects a particular button, the recordset from the main form...
0
by: sasan3 | last post by:
Let's say I have the following table: A B C D ----------- 1 1 1 6 1 1 2 7 2 2 3 8 2 2 4 9
3
by: Solel Software | last post by:
Hello, I have a basic question. I have a DataTable of information without a database store (it's only in memory). I am looking to somehow query the DataTable to find out which row(s) satisfy...
1
by: WStoreyII | last post by:
I am trying to make a finances database. I have a master table which contains transaction header info and then a line details table. What i want is to make a reconcile query where i can see...
0
by: Bernd R. | last post by:
Hi, I am accessing an Access Database with VB.net 2005 with ADO.net. The data are displayed on a form in Text Boxes (there is no grid on the form). Now I'd like to place a ComboBox on the form...
1
by: teenagelcruise | last post by:
hi, i have a problem with my code which is i cannot update and addnew data into the database but i can delete the data.plz give me an idea.this is my code that i wrote. <html> <head> <meta...
0
ADezii
by: ADezii | last post by:
When you create an ADO Recordset, you should have some idea as to what functionality the Recordset does/does not provide. Some critical questions may, and should, be: Can I add New Records to the...
2
by: wallconor | last post by:
Hi, I am having a problem using Dreamweaver CS3 standard recordset paging behavior. It doesn’t seem to work when I pass parameter values from a FORM on my search page, to the recordset on my...
2
by: Jollywg | last post by:
I'm using 2 forms one is a customer entry form and the second is an invoice entry form for that particular customer. I'm sending the invoice form the customer id number to keep the link up. The...
3
pbala
by: pbala | last post by:
Hello, I have problem in reset the new password with old one.For that I used the code as Set rstreset = New ADODB.Recordset strtable = "Update USERS SET rstreset!Password = '" & upwd & "' where...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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...
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
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,...

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.