查看完整版本: 连ODBC

sky2008 2006-12-18 14:40

连ODBC

我想在记事本下输入P 但回访时提示
odbc.rec(28) Error: Type mismatch
odbc.rec(28) Error: Type mismatch, parameter 1 in subprogram 'InputKeys'
脚本如下:
Sub main
    Dim p as integer
    Dim k,i as integer
    Dim connection As Long
    Dim destination(1 To 50, 1 To 125)  As Variant
    Dim retcode As long
    Dim query as String
    Dim outputStr as String
   
    connection = SQLOpen("DSN=sy",outputStr)
    query = "select busi_code from user"  
    retcode = SQLExecQuery(connection,query)
    retcode = SQLRetrieve(connection:=connection,destination:=destination)
     k=int(destination(1,1))
'   Get the next 50 rows of from the result set
    query = "select busi_code from user"  
    retcode = SQLExecQuery(connection,query)
    retcode = SQLRetrieve(connection:=connection,destination:=destination)
    randomize timer()
    for i=1 to 5
    p=int(rnd*k)
    p=int(destination(1,p))
     
  
   
    Window SetContext, "Caption=que.txt - 记事本", ""
    EditBox Click, "ObjectIndex=1", "Coords=52,23"
    InputKeys  p + "{ENTER}"
  
  
  
  
  next
   
    retcode = SQLClose(connection)

End Sub

ilovejolly 2007-1-30 16:59

你应该说说想完成什么功能

提示已经说的很清楚了,InputKeys  p + "{ENTER}"这句有问题
页: [1]
查看完整版本: 连ODBC