Visual Basic Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsProgrammingVisual 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 ASP Free Forums Sponsor:
  #1  
Old July 6th, 2006, 11:43 PM
Enzo Enzo is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Nov 2005
Location: HK
Posts: 178 Enzo User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 15 h 43 m 26 sec
Reputation Power: 4
Get value from the DB

Code:
Private Sub Command1_Click()
    crt = 0
    Text1.Text = rsEnsemble.Fields.Item(0).Name
    Do While rsEnsemble.EOF = False
        Lat(crt) = CDbl(rsEnsemble.Fields.Item(3).Value)
        Lon(crt) = CDbl(rsEnsemble.Fields.Item(4).Value)
        MsgBox "!!!"
        Text2.Text = Lat(crt)
        crt = crt + 1
    Loop
    Call CloseDB
    Command1.Enabled = False
End Sub


What wrong with the code?
the error occurs on the the line highlight
Run-time error "3021"

I juz want to sub the value into the Lat array
However, it can not execute the do while loop.Why?

Reply With Quote
  #2  
Old July 7th, 2006, 02:24 AM
sync_or_swim's Avatar
sync_or_swim sync_or_swim is offline
Moderator
Click here for more information.
 
Join Date: Mar 2006
Location: South Wales
Posts: 1,932 sync_or_swim User rank is General 4th Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 4th Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 4th Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 4th Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 4th Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 4th Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 4th Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 4th Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 4th Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 4th Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 4th Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 4th Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 4th Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 4th Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 4th Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 4th Grade (Above 100000 Reputation Level) 
Time spent in forums: 1 Month 6 Days 22 h 34 m 58 sec
Reputation Power: 1243
Its hard to tell without seeing the rest of your code, but I believe that RTE 3021 means that no current record is selected. My guess would be that you have not filled the recordset correctly i.e. no records were returned by the SQL statement.

Can you post the bit of code that creates and populates the recordset.

Reply With Quote
  #3  
Old July 8th, 2006, 12:09 AM
Enzo Enzo is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Nov 2005
Location: HK
Posts: 178 Enzo User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 15 h 43 m 26 sec
Reputation Power: 4
Quote:
Originally Posted by sync_or_swim
Its hard to tell without seeing the rest of your code, but I believe that RTE 3021 means that no current record is selected. My guess would be that you have not filled the recordset correctly i.e. no records were returned by the SQL statement.

Can you post the bit of code that creates and populates the recordset.


Thanks for your help. the problem is solved.
i think you are right. as my friend have not fully completed the recordset.

Reply With Quote
Reply

Viewing: ASP Free ForumsProgrammingVisual Basic Programming > Get value from the DB


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 3 hosted by Hostway
Stay green...Green IT