Sign in to follow this  
Followers 0
silvano

query and _arrayAdd

5 posts in this topic

hi,

can i add my elaborated query result in to array?

and can i count total records in the query result?

$q.execute( "select COUNTRY_NAME from countries WHERE COUNTRY_ID='UK'", $conn )

While not $q.EOF

    MsgBox(0, "Result", "COUNTRY = " & $adors.Fields("COUNTRY_NAME") .Value)

; elaborate the result
; add to array

    $q.MoveNext
WEnd
$conn.close

_arrayDisplay()

than you

Share this post


Link to post
Share on other sites



As far as I know Execute is for stored procedures.

Try to use $adors.Open()

adors.open don't work...

execute work very good, but my problem is to return # of filed and _arrayAdd value

Share this post


Link to post
Share on other sites

up please

Share this post


Link to post
Share on other sites

hi,

can i add my elaborated query result in to array?

and can i count total records in the query result?

$q.execute( "select COUNTRY_NAME from countries WHERE COUNTRY_ID='UK'", $conn )

While not $q.EOF

    MsgBox(0, "Result", "COUNTRY = " & $adors.Fields("COUNTRY_NAME") .Value)

; elaborate the result
; add to array

    $q.MoveNext
WEnd
$conn.close

_arrayDisplay()

than you

can i add my elaborated query result in to array?

you need to create a recordset:

$Rec = ObjCreate("ADODB.Recordset");

$SQL = "select COUNTRY_NAME from countries WHERE COUNTRY_ID='UK'"

$Rec.Open( $SQL, $conn );

$myNew2DimensionalArray = $Rec.GetRows()

and can i count total records in the query result?

$recCount =$Rec.RecordCount

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0