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:
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now!
  #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: 459 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: 13 h 44 m 22 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: 459 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: 13 h 44 m 22 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


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





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway