// Profile pro
SQLCA.DBMS = "MSS Microsoft SQL Server"
SQLCA.Database = "try"
SQLCA.LogPass = "******"
SQLCA.ServerName = "506-31"
SQLCA.LogId = "aaa"
SQLCA.AutoCommit = False
SQLCA.DBParm = ""
connect using sqlca;
open(w_main)
click 按钮代码如下:
DECLARE p PROCEDURE FOR proc_no
@x = :sle_1.text,
@y = :sle_2.text ;
execute p;
fetch p into :sle_2.text;
if sqlca.sqlcode<>0 then
messagebox("Test Procedure Error",sqlca.sqlerrtext+"!")
close p;
else
messagebox("successful!",sle_2.text)
close p;
end if
在sql server 2000中创建的过程如下:
CREATE proc proc_no (@x varchar(50),@y varchar(50) output)
as
select @y=name from mytable where id=@x
GO
表结构如下:
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[mytable]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[mytable]
GO
CREATE TABLE [dbo].[mytable] (
[id] [varchar] (50) COLLATE Chinese_PRC_CI_AS NOT NULL ,
[name] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL
) ON [PRIMARY]
GO
为什么点击click按钮它说:transaction not connected