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

recordset VB.net

7
I have an inner join between 2 tables that have the same fields.
I need the syntax to read the values from the recordset specifying from which table to get the value.
In VB 6 it could be written for example as follows:

rs!Table.column

In VB.NET when I write

rs(“Table.column”)

It gives me the following error:

“An unhandled exception of type 'System.Runtime.InteropServices.COMException' occurred in adodb.dll

Additional information: Item cannot be found in the collection corresponding to the requested name or ordinal.”
Jan 9 '07 #1
3 3138
hariharanmca
1,977 1GB
I have an inner join between 2 tables that have the same fields.
I need the syntax to read the values from the recordset specifying from which table to get the value.
In VB 6 it could be written for example as follows:

rs!Table.column

In VB.NET when I write

rs(“Table.column”)

It gives me the following error:

“An unhandled exception of type 'System.Runtime.InteropServices.COMException' occurred in adodb.dll

Additional information: Item cannot be found in the collection corresponding to the requested name or ordinal.”

You cannot give like this rs(“Table.column”)

if its same name then you can give alies name for one field then use that fieldname

rs(“AliesName”)
Jan 9 '07 #2
ooshy
7
actually i have two tables:
this is the line that is giving the error im not using

Desc = rs ( "[GLOBAL].Description " ).Value
Jan 9 '07 #3
hariharanmca
1,977 1GB
actually i have two tables:
this is the line that is giving the error im not using

Desc = rs ( "[GLOBAL].Description " ).Value
Use like this
====================QRY=========================

SELECT table1.field1 as fieldof1, table2.field1 as fieldof2
FROM Table1 INNER JOIN table2 ON Table1.Field2 = table2.Field2


then you can get two different field names

then use
rst.field("fieldof1") 'for table1.field1
and
rst.field("fieldof2") 'for table2.field1
Jan 9 '07 #4

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

Similar topics

0
by: gary artim | last post by:
Hi All, I have a problem using DBIx::RecordSet. I get correct results but continue to get these messages on stderr. I looked at Compat.pm and it seems to be pointing out a problem with my call...
4
by: Tom | last post by:
I want to open a recordset object on an .asp page. When I open the recordset I would like to use a stored procedure that expects a parameter to be passed for the stored procedure. I will then use...
19
by: Adam Short | last post by:
I am trying to write a routine that will connect a .NET server with a classic ASP server. I know the following code doesn't work! The data is being returned as a dataset, however ASP does not...
0
by: CFW | last post by:
I thought this was going to be easy but I'm missing something . . . I need to open an ADODB recordset using the recordset source for a list box on my for. When my form opens, the list box ADODB...
6
by: lenny | last post by:
Hi, I've been trying to use a Sub or Function in VBA to connect to a database, make a query and return the recordset that results from the query. The connection to the database and the query...
36
by: kjvt | last post by:
Based on a prior posting, I've written a function to convert a recordset to a dataview. The first call to the function for a given recordset works perfectly, but the second call always returns a...
0
ADezii
by: ADezii | last post by:
Most Access Users realize that Recordsets, being virtual representations of a Query, Table, or SQL Statement, exist only in our PC's memory. They, and the data they contain, literally exist at one...
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...
6
by: Oko | last post by:
I'm currently developing an MS Access Data Project (.adp) in MS Access 2002. One of the reports within the DB uses data that is Dynamic and cannot be stored on the SQL Server. To resolve this, I...
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...
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
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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
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.