求救:datastore.create 出错
如题,代码如下
datastore ldst_temp
s_sql = "select top " + string( ai_row_count ) + " * from " + as_table_name + &
" where " + as_array + " not in (select top " + string( (ai_page - 1) * ai_row_count ) + &
" " + as_array + " from " + as_table_name + " order by " + as_array + ") order by " + as_array
//分页控制
s_syntax = SQLCA.SyntaxFromSQL(s_sql, 'Style(Type= grid)', error_syntaxfromSQL)
//根据SQL语句生成数据窗口代码
IF Len(error_syntaxfromSQL) > 0 THEN //生成数据窗口源代码出错处理
// messagebox("错误", error_syntaxfromSQL)
return -3
ELSE
ldst_temp.Create(s_syntax, error_create) //根据代码创建数据此数据窗口
IF Len(error_create) > 0 THEN //生成数据窗口出错处理
// messagebox("错误", error_create)
return -4
END IF
END IF
编译没有问题,运行时提示ldst_temp.Create(s_syntax, error_create)这行出错
错误提示为:
application terminated.
Error: Null object reference at (这行)
这个错误不像是SQL语句有问题(试过用其他简单的SQL语句代替,错误提示不变),想不懂了。求各位大侠帮忙