473,507 Members | 2,460 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Question regarding datagrids in vb6

2 New Member
I have 2 separate tables that need to be joined together. I'm trying to display certain fields from both tables by joining them with a matching field(same values but different column name) The user enters their employee id, then I need to return the other field values associated with that specific id# in a datagrid.

So far I'm able to return the other field values from one of my tables according to the id# entered

Expand|Select|Wrap|Line Numbers
  1. 'my connection stuff is here
  2. rs.open "select swpNum, swpInfo, swpType from tblSwipes WHERE (swpNum='"& sNum &"') and swpType=1 order by etc...
  3. set datagrid.datasource=rs
I'm ok up to here..The datagrid displays the 3 fields associated with the # the user enters. But I'm having trouble when I try to join tblSwipes with tblEmp to get fields returned from that table as well. Here's what I have for my new query

Expand|Select|Wrap|Line Numbers
  1. rs.open "SELECT tblEmp.lastName,tblEmp.firstName,  tblEmp.payNum, tblSwipes.swpNum, tblSwipes.swpType  
  2. FROM tblEmp INNER JOIN tblSwipes 
  3. ON tblEmp.payNum=tblSwipes.swpNum 
  4. WHERE (swpNum='"& sNum &"') and swpType=1 
  5. order by etc...
  6.  
  7. set datagrid2.datasource =rs
Nothing is shown in the datagrid using this query..any tips or suggestions on another way of doing this would be greatly appreciated.
Jun 19 '10 #1
2 1025
irfanafzal
12 New Member
@Velocis
which database you are using Access or sql server if you r using Access then
try this before opening recordset
Rs.CursorLocation = adUseClient
Jun 21 '10 #2
Velocis
2 New Member
i'm using sql server. the problem was with my inner join clause. i just got rid of that and it worked. thanks for the response : )
Jun 22 '10 #3

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

Similar topics

4
1789
by: Francis Lavoie | last post by:
Hello I have some questions regarding webframework, I must say that I quite lost and these questions are basicly to help me understand the way it work. I have some knowledge with PHP and JSP....
3
2189
by: Samuel | last post by:
I wrote a very simple httpmodule and tried to compile it with no success. This is my code: ============== Imports System Imports System.Web Imports Microsoft.VisualBasic NameSpace...
7
2443
by: Squignibbler | last post by:
Hi all, I have a question regarding the C++ programming language regarding the nature of the relationship between pointers and arrays. If the statement MyArray is functionally identical to...
2
4150
by: Arun Prasath | last post by:
Hi all, I have the following question regd pointer typecasting. Is the following type of pointer typecasting valid? #define ALLOC(type,num) ((type *)malloc(sizeof(type)*num)) /*begin...
2
1613
by: Dean R. Henderson | last post by:
For an ASP.NET web application, is there a way for one session (with appropriate security authorization) to set a HttpSessionState variable to point to another session and execute the Abandon...
1
1326
by: Terrance | last post by:
I was wondering if someone can help me with my question regarding the configuration system functionality in the .NET Framework 2.0 for VB. My question is, if I have a application configuration...
5
1788
by: archana | last post by:
Hi all, I am using timer to do some functionality on user specified time. I am using system.timers.timer class and its timer to do this functionality. What i am doing is i set autoreset to...
4
2291
by: Benny Van | last post by:
Hi all! I have a question regarding a windows operating system function: I was asked to write a small program for a homework to display the user name and computer name and the system time out to a...
3
2453
by: somenath | last post by:
Hi All, I have one question regarding the conditional operator. In the draft C99 standard it is mentioned that "1 The following are the sequence points described in 5.1.2.3: -- The call to a...
5
2220
by: somenath | last post by:
Hi All , I have one question regarding scope and lifetime of variable. #include <stdio.h> int main(int argc, char *argv) { int *intp = NULL; char *sptr = NULL;
0
7223
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
7110
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
5623
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,...
1
5041
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...
0
4702
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3179
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1540
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
758
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
411
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.