set conn=createobject("ADODB.Connection")
conn.open strconn
set rs=createobject("ADODB.Recordset")
rs.open "select number1,number2 from test", conn
rs.MoveFirst
do while not rs.eof
testnumber1=rs.fields(0).value
testnumber2=rs.fields(1).value
rs.MoveNext
loop
rs.close
conn.close
set rs=nothing
set conn=nothing作者: watercloset 时间: 2006-6-10 09:58
谢谢,我这边可以调试通过了。感谢一下。我能再问一下吗?在SQABasic中如何在Function中返回一个二维的数组。我这样写对不对呢?
Function test(…………..) As Variant
dim RobotData () As Variant
redim preserve RobotData (2, 9)
………………
RobotData (0, 1) = rs.field(0).value
test = RobotData(,) ‘还是这样写:test = RobotData? Test = RobotData()?
set conn=createobject("ADODB.Connection")
conn.open strconn
set rs=createobject("ADODB.Recordset")
rs.open "select number1,number2 from test", conn
rs.MoveFirst
do while not rs.eof
testnumber1=rs.fields(0).value
testnumber2=rs.fields(1).value
rs.MoveNext
loop
rs.close
conn.close
set rs=nothing
set conn=nothing