book.sra
来自「pb所需编程技巧和事例」· SRA 代码 · 共 52 行
SRA
52 行
$PBExportHeader$book.sra
$PBExportComments$Generated Application Object
forward
global type book from application
end type
global transaction sqlca
global dynamicdescriptionarea sqlda
global dynamicstagingarea sqlsa
global error error
global message message
end forward
global variables
string username
string LoginOk
end variables
global type book from application
string appname = "book"
end type
global book book
on book.create
appname="book"
message=create message
sqlca=create transaction
sqlda=create dynamicdescriptionarea
sqlsa=create dynamicstagingarea
error=create error
end on
on book.destroy
destroy(sqlca)
destroy(sqlda)
destroy(sqlsa)
destroy(error)
destroy(message)
end on
event open;// Profile book
SQLCA.DBMS = "ODBC"
SQLCA.AutoCommit = False
SQLCA.DBParm = "ConnectString='DSN=book;UID=dba;PWD=sql'"
Connect Using SQLCA;
if sqlca.sqlcode=0 then
open(w_main)
else
messagebox("提示:","连接数据库出错!")
end if
end event
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?