473,399 Members | 3,656 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,399 software developers and data experts.

Record Set Issues Help

This is a part of my code in VB:

.
.
Expand|Select|Wrap|Line Numbers
  1. Dim rsora1 As ADODB.Recordset
  2. .
  3. .
  4. Set cnOra = New ADODB.Connection
  5. .
  6. .
  7. Set rsora1 = New ADODB.Recordset
  8. .
  9. .
  10. rsora1.CursorLocation = adUseServer
  11. .
  12. .
  13. If Worksheets.Item("sheet1").Cells(j + b, i).Value <> rsora1![val_arr] Then
i want to compare the value in a cell in excel to the value in the resultset. the problem is that <val_arr> in rsora1![ ] is a array variable(of type string), ie, a(i-3)=val_arr. How do i go about it???
Mar 14 '07 #1
5 1339
willakawill
1,646 1GB
Hi. In the code you have posted, rsora1 has not been populated with any values. Could you post the code where val_arr is declared and assigned a value?
Mar 14 '07 #2
Hi. In the code you have posted, rsora1 has not been populated with any values. Could you post the code where val_arr is declared and assigned a value?
here i populate rsora1:
rsora1.Open "select rowid,CUSTOMER_ID,ITEM_NO,ITEM_DESCRIPTION,BEGIN_D ATE,END_DATE from XXITEM_MAP_TABLE where CUSTOMER_NO = " & cust_no, cnOra, adOpenForwardOnly (cust_no is a variable containing a value)

these are the array values:
a(0) = "CUSTOMER_ID"
a(1) = "ITEM_NO"
a(2) = "ITEM_DESCRIPTION"
a(3) = "BEGIN_DATE"
a(4) = "END_DATE"

i use a loop to get the specific value from the array:
For i = 3 To 13 Step 2
val_arr = a((i - 3) / 2)

now i do this:
If Worksheets.Item("sheet1").Cells(j + b, i).Value <> rsora1![val_arr] Then.....
but i can't get rsora1![val_arr] to point to a particular value in the resultset.
help me!!
Mar 15 '07 #3
willakawill
1,646 1GB
The syntax for ado is:
Expand|Select|Wrap|Line Numbers
  1. rsora1(val_arr)
I have never used a variable here and I recommend that you don't either. It is far easier for you to use this syntax:
Expand|Select|Wrap|Line Numbers
  1. rsora1((i - 3) / 2)
The result of this loop:
Expand|Select|Wrap|Line Numbers
  1. For i = 3 To 13 Step 2
  2. val_arr = a((i - 3) / 2)
Is that val_arr always ends the loop as a(5) and there is no a(5)
Mar 15 '07 #4
The syntax for ado is:
Expand|Select|Wrap|Line Numbers
  1. rsora1(val_arr)
I have never used a variable here and I recommend that you don't either. It is far easier for you to use this syntax:
Expand|Select|Wrap|Line Numbers
  1. rsora1((i - 3) / 2)
The result of this loop:
Expand|Select|Wrap|Line Numbers
  1. For i = 3 To 13 Step 2
  2. val_arr = a((i - 3) / 2)
Is that val_arr always ends the loop as a(5) and there is no a(5)
problem solved
thanx a million
Mar 15 '07 #5
willakawill
1,646 1GB
problem solved
thanx a million
You are very welcome
Mar 15 '07 #6

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

Similar topics

1
by: sixsoccer | last post by:
I have built a database with a <Mainform> and a <Subform>. My problem is twofold. 1. My subform is set as a continuos form with AllowAddiotions set to NO (ie. a list of Issues to the client on...
3
by: vanvee | last post by:
Hi I am trying to program a VB.Net Windows application (in a client server environment with multiple users) and am seeking some help about a possible technique to handle concurreny issues. I am...
1
by: Kurt | last post by:
If one has a working subform, adds a new field to the subform's table, then adds the field (control) to the subform, MS Access 2003 (11.6566.6568) SP2 will not see that new field in Form View. The...
26
by: Jimmy | last post by:
ill have a database with 1 table and 3 fields: ID FIRSTNAME LASTNAME (the ID field will be the auto incrementing index) there might be 10 records in the DB, there might be 10,000. i...
3
by: Bruhah | last post by:
First off, I have VERY limited experience in MS Access most of it is self taught, so keep that in mind. Here is my issue: I have a form OpenIssues that uses qryOpenIssues to display all issues...
9
by: =?Utf-8?B?UHJhdmlu?= | last post by:
We are using .net Framework 1.1 We are having one page on which we are using this Grid component. From this page we open a popup for adding new record as well as for editing an existing record...
8
by: =?Utf-8?B?bWlrZWc=?= | last post by:
Hi, I am building a small Help Desk application for my company and need to be able to edit "open" help desk issues. I use a simple datagrid to display each issue (6 per page) , with an Edit...
4
by: QntmPg | last post by:
Hi all, I have read through what I could find on previous questions regarding using the OpenArgs property, but I'm still not able to get my form to open correctly. I'm not sure exactly where the...
1
by: lrw0831 | last post by:
I have an Access database that is used to keep track of issues that the department receives. What we need is a way to add attachments to issues, but only by adding the path name that is a hyperlink...
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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...

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.