如何把数据库某个字段到赋值到一个变量中
发现开始的想法是比较原始的,先改成从数据库中读取订单号。但有新的问题:如何把数据库某个字段(字符串)赋值到一个变量中,如下:
Sub Main
Dim connectionAs long
Dim retcode As Variant
Dim outputstr,query as string
Dim out(1 to 1,1 to 13) as variant
connection = SQLOpen("DSN=book;UID=sa;PWD=sa")
query = "select * FROM (select * from book_ID a where CustNo = '0001' order by orderNO desc) WHERE ROWNUM = 1"
retcode = SQLExecQuery(connection,query) '订单号格式为:200604070531H
'=============请教数据库某个字段(字符串)赋值到一个变量中===========================
retcode = SQLRetrieve(connection,out())
Browser NewPage,"HTMLTitle=Book;Index=0",""
EditBox Click, "Name=OrderNo", "Coords=34,6"
InputKeys "怎么输入????"
'=================================================
retcode = SQLClose(connection)
End Sub
[ 本帖最后由 xingnet 于 2006-4-7 15:22 编辑 ] 详细点、 系统生成订单号到显示在页面中,试着直接Copy此订单号到剪贴板,但回放的时候,定位的偏移了很多,导致复制的内容不正确。谢谢! 为什么要复制?楼主想验证什么 通过订单号查询此订单,并且修改此订单。 你直接取textbox的text不就得了,和剪贴板有什么关系 谢谢,我是新手,请问使用什么语句取Text的订单号,还有如果在查询栏中输入此订单号。多谢了!
代码中的订单号:200604061124T
注:附件为此页的代码 发现开始的想法是比较原始的,先改成从数据库中读取订单号。
但有新的问题:如何把数据库某个字段(字符串)赋值到一个变量中,如下:
Sub Main
Dim connectionAs long
Dim retcode As Variant
Dim outputstr,query as string
Dim out(1 to 1,1 to 13) as variant
connection = SQLOpen("DSN=book;UID=sa;PWD=sa")
query = "select * FROM (select * from book_ID a where CustNo = '0001' order by orderNO desc) WHERE ROWNUM = 1"
retcode = SQLExecQuery(connection,query) '订单号格式为:200604070531H
'=============请教数据库某个字段(字符串)赋值到一个变量中===========================
retcode = SQLRetrieve(connection,out())
Browser NewPage,"HTMLTitle=Book;Index=0",""
EditBox Click, "Name=OrderNo", "Coords=34,6"
InputKeys "怎么输入????"
'=================================================
retcode = SQLClose(connection)
End Sub
[ 本帖最后由 xingnet 于 2006-4-7 15:23 编辑 ] 问题已经解决:)
Sub Main
Dim connectionAs long
Dim retcode As Variant
Dim outputstr,query as string
Dim out(1 to 1,1 to 1) as variant
connection = SQLOpen("DSN=book;UID=sa;PWD=sa")
query = "select * FROM (select * from book_ID a where CustNo = '0001' order by orderNO desc) WHERE ROWNUM = 1"
retcode = SQLExecQuery(connection,query) '订单号格式为:200604070531H
retcode = SQLRetrieve(connection,out())
Browser NewPage,"HTMLTitle=Book;Index=0",""
EditBox Click, "Name=OrderNo", "Coords=34,6"
InputKeys out(1,1)
retcode = SQLClose(connection)
End Sub
页:
[1]