473,395 Members | 2,443 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.

How do I get at this fieldname?

I have this SQL statement in my VB code...
mySQL = "SELECT * FROM workord" & _
" INNER JOIN customer ON workord.cust_num =
customer.cust_num" & _
" WHERE workord.inv_num = '" & sInvNum & "'"

rs.Open mySQL, myConnection, adOpenDynamic,
adLockOptimistic, adCmdText

Basically doing an Inner Join on workord and customer via an
invoice number field common
to both.

Problem is,both workord and customer have a field named
"flag".
Is there any way to access one (or the other) with ADO?

Thanks for any help.
Oct 7 '05 #1
2 3623
MySQL will return the fields any ambigous fields with their table name dot
field name so the following should work

debug.print rs.fields("workord.flag")
debug.print rs.fields("customer.flag")

or you could define the fields in your query

eg "SELECT customer.flag AS CustomerFLAG, workord.flag AS workordFLAG " & _
" INNER JOIN customer ON workord.cust_num =
customer.cust_num" & _
" WHERE workord.inv_num = '" & sInvNum & "'"

"Tony Van" <to*********@comcast.net> wrote in message
news:ud********************@comcast.com...
I have this SQL statement in my VB code...
mySQL = "SELECT * FROM workord" & _
" INNER JOIN customer ON workord.cust_num = customer.cust_num" & _
" WHERE workord.inv_num = '" & sInvNum & "'"

rs.Open mySQL, myConnection, adOpenDynamic, adLockOptimistic, adCmdText

Basically doing an Inner Join on workord and customer via an invoice
number field common
to both.

Problem is,both workord and customer have a field named "flag".
Is there any way to access one (or the other) with ADO?

Thanks for any help.

Oct 7 '05 #2
Worked perfectly!
Oct 8 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Margaret MacDonald | last post by:
It appears that the 'table.field' dot notation is not preserved by php's mysql library. I can create some join 'SELECT a.id, b.id FROM table1 AS a, table2 AS b' but when I try to refer to the...
4
by: MARTIN DAVIES | last post by:
I hope you can help. My Linux MYSQL 3.23.52 database server is working OK generally. However, in a database I have a field name that ends with a # (hash UK as opposed to £ which is a pound UK)...
6
by: geradeaus | last post by:
Hello, I was wondering if I could do the following : can I change the formname and fieldname with an argument? This way I can re-use the script multiple times. My code (that doesn't work): ...
3
by: Sagaert Johan | last post by:
The update seems to fail becorse of the fieldname in my DB One of the fields is called "Zone" in my MDB If i change the fieldname in both the database and in my test application, the error is...
1
by: ad | last post by:
Hi, What is the difference between (string)dr and dr.ToString();
1
by: Abe Simpson | last post by:
Hi all, My form file has this attribute: <META http-equiv="Content-Type" content="text/html; charset=utf-8"> The form's action points to an .aspx file where I try to retrieve field values...
1
by: Simon | last post by:
Dear reader, If there is now broken reference in the VBA library and I run the code Mid(;3;2) an error massage can by pop's up "Not a valid instruction". After a reconnection of the...
1
by: Simon | last post by:
Dear reader, The following functions gives me some problems: Mid(,3,2) and Left() and Date(). On one pc it works perfect and on the other one an error message pop's up "Not a valid...
3
by: xhe | last post by:
I have just upgraded my php version form php4 to php5. and I met this problem, and don't know if you know the solution. My site was written in PHP4, and most parts can be running smoothly in PHP5,...
3
by: wquatan | last post by:
Hi For a parsing routine with more than 100 fields, I'm looking a way to get values out of Fields by determining the Fieldname on the fly. As a simple example : Let's assume the following ...
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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.