Visual Basic Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreVisual Basic Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old August 3rd, 2003, 09:39 AM
Eros_ Eros_ is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Posts: 10 Eros_ User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
2 Value assign to one Ado

/*Note: PageDB has been assigned to AdoPageDB

How can i make my Ado to able to have the 2 value of AlarmtableDyna and UserDyna?
Since i know that i can't just AdoPageDB.Recordset = SQL because the UserDyna's value will overright AlarmtableDyna's value.

SQL = "SELECT * FROM AlarmTable WHERE AlarmTable.AlarmID = "
SQL = SQL + Str(i + 1)
Set AlarmtableDyna = PageDB.OpenRecordset(SQL)

SQL = "SELECT * FROM UserTable WHERE UserTable.AlarmGroup = "
SQL = SQL + Str(AlarmtableDyna.Fields(2)) + " AND UserTable.OnCall = True "

Set UserDyna = PageDB.OpenRecordset(SQL)

Reply With Quote
  #2  
Old August 3rd, 2003, 11:09 AM
nopoints nopoints is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Location: Windsor ON, Canada
Posts: 462 nopoints User rank is Corporal (100 - 500 Reputation Level)nopoints User rank is Corporal (100 - 500 Reputation Level)nopoints User rank is Corporal (100 - 500 Reputation Level)nopoints User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 14 h 1 m 30 sec
Reputation Power: 8
Well first that is not ADO it's DAO. Second you should use CStr instead of Str to convert to a string. if you want two different tables then having two recordsets is normal. unless you want to combine the tables.
__________________
Programmer's Corner

Reply With Quote
  #3  
Old August 3rd, 2003, 12:31 PM
Eros_ Eros_ is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Posts: 10 Eros_ User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
okie.. but how do i make it such that i dun need to assign 2 variable but it will noe which value's i want it

Reply With Quote
  #4  
Old August 3rd, 2003, 12:52 PM
nopoints nopoints is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Location: Windsor ON, Canada
Posts: 462 nopoints User rank is Corporal (100 - 500 Reputation Level)nopoints User rank is Corporal (100 - 500 Reputation Level)nopoints User rank is Corporal (100 - 500 Reputation Level)nopoints User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 14 h 1 m 30 sec
Reputation Power: 8
i'm not sure what you mean. what's wrong with having two variables? what do you mean by values?

Reply With Quote
  #5  
Old August 3rd, 2003, 01:00 PM
Eros_ Eros_ is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Posts: 10 Eros_ User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
just to cut down the amount of variable used.
Such know the value i need for 2 different values with the same table
the coding is below:
SQL = "SELECT * FROM AlarmTable WHERE AlarmTable.AlarmID = "
SQL = SQL + Str(101)
AdoPageDB.RecordSource = SQL
AdoPageDB.Refresh
Set AlarmtableDyna = AdoPageDB.Recordset

SQL = "SELECT * FROM UserTable WHERE UserTable.AlarmGroup = "
SQL = SQL + Str(AlarmtableDyna.Fields(2)) + " AND UserTable.OnCall = True "
AdoPageDB.RecordSource = SQL
AdoPageDB.Refresh
Set UserDyna = AdoPageDB.Recordset

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreVisual Basic Programming > 2 Value assign to one Ado


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump



 Free IT White Papers!
 
How to Present Effectively Online
This white paper offers practical and actionable advice on the key steps that any presenter should consider as they plan and execute a Webinar or online meeting.

 
Open Source Security Myths
Open Source Software (OSS) is computer software whose source code is available to the general public with relaxed or non-existent intellectual property restrictions (or arrangement such as the public domain), and is usually developed with the input of many contributors.

 
Power and Cooling Capacity Management for Data Centers
This paper describes the principles for achieving power and cooling capacity management.

 
Scalable, Fault-Tolerant NAS for Oracle - The Next Generation
For several years NAS has been evolving as a storage alternative for Oracle databases, and for good reason: NAS is quite often the simplest, most cost-effective storage approach for Oracle. Learn about the benefits that HP's approach to scalable NAS brings to Oracle environments in this comprehensive white paper.

 
Understanding Web Application Security Challenges
This white paper discusses many common threats and preventive measures for Web application security, and explains what you can do to help protect your organization.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2009 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway
Stay green...Green IT