|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
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? |
|
#2
|
||||
|
||||
|
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. |
|
#3
|
|||
|
|||
|
Quote:
Thanks for your help. the problem is solved. i think you are right. as my friend have not fully completed the recordset. |
![]() |
| Viewing: ASP Free Forums > Programming > Visual Basic Programming > Get value from the DB |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|