|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
SlickEdit: Code in over 40 languages across 7 platforms. SlickEdit’s unmatched power, speed, and flexibility allows even the most accomplished developers to write better code faster. Download a free trial today! |
|
#1
|
|||
|
|||
|
how to retrieve fields from database into an array
how to store entres of a table into one arry and the table contain only one colum
and that arry must be dynamic please reply i used this code ReDim arr(i) As String Dim dbaddress As New ADODB.Connection Dim rsaddress As New ADODB.Recordset dbaddress.Open "dsn=new" Set rsaddress = dbaddress.Execute("select * from company") //company as table i = 0 Do Until rsaddress.EOF arr(i) = rsaddress("company")//company is field name rsaddress.MoveNext i = i + 1 Loop End Sub //it gives subcript is out of bounds |
|
#2
|
|||
|
|||
|
Do a loop until instead of a do while. You are incrementing outside of the table before it gets a chance to check again. This will solve your problem
|
|
#3
|
|||
|
|||
|
The easiest way to get a recordset into an array is to use the getrows() method of the ado recordset, if you can live with the way the array is structured.
__________________
====== Doug G ====== I didn't attend the funeral, but I sent a nice letter saying I approved of it. --Mark Twain |
![]() |
| Viewing: ASP Free Forums > Programming > Visual Basic Programming > how to retrieve fields from database into an array |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|
|
|