急! PB6.5不能连接数据库,报错为:
PB6.5以前可以正常连接数据库,最近因重新做了服务器,设置和原来一样,原来在PB下开发的应用程序可以正常连接数据库并正常使用,但是开启PB连接数据库却报:
stored procedure 'sp_pb60table' not found. specify owner objectname or use sp_help to check whether the object exists (sp_help may produce lots of output)
大致的意思好像是说找不到于PB相关的一个存储过程,
这个存储过程是在服务器上建立的吗?
还有其他原因吗?
如何解决这个问题?
解决问题给高分
问题点数:100、回复次数:9Top
1 楼jackygan(一剑飘香)回复于 2002-10-22 22:43:48 得分 10
存储过程当然是在服务器上的,至于出现这个问题,检查是否连接了正确的数据库。Top
2 楼balloonman2002()回复于 2002-10-22 23:13:39 得分 30
PB65的安装盘上有两个文件叫:PBSYC。SQL和PBSYC2。SQL,把这两个文件在PB中执行一下即可,包好,:)Top
3 楼samchung(酸菜)回复于 2002-10-23 03:31:10 得分 20
因为在服务器上的服务包没有了。你要用PB安装盘里的server目录下的相关的脚本执行一下就可以了。同一目录下的PB60SERV.DOC里有关于什么数据库用什么脚本的详细说明Top
4 楼george77(F22)回复于 2002-10-23 08:12:20 得分 40
我以前也碰到这个问题,后来在sybase数据库中执行了一个pbsyc.sql文件,就解决问题了,我分开贴在下面:
/*---------------------------------------------------------*/
/* The "use" stmt below connects you to sybsystemprocs. */
/* SPECIAL INSTRUCTIONS FOR WISQL USERS: */
/* WISQL appears to require that the command */
/* "use sybsystemprocs" be issued by itself. Once you */
/* connect to sybsystemprocs, issue a "file, open, */
/* PBSYC.SQL" to read this script into the WISQL command */
/* buffer. Next, delete the "use sybsystemprocs" command */
/* and the "go" below. Then issue "query, execute all". */
/* */
/* By default, execute authority for these procedures is */
/* granted to "public". You may search and replace */
/* "public" with a group-id if you wish tigher security. */
/*---------------------------------------------------------*/
use sybsystemprocs
go
/*---------------------------------------------------------*/
/* Drop old PBSYC system procedures from sybsystemprocs. */
/*---------------------------------------------------------*/
if exists (select 1 from sysobjects
where name = 'sp_pb60column' and type = 'P')
begin
drop procedure sp_pb60column
end
go
if exists (select 1 from sysobjects
where name = 'sp_pb60primarykey' and type = 'P')
begin
drop procedure sp_pb60primarykey
end
go
if exists (select 1 from sysobjects
where name = 'sp_pb60pkcheck' and type = 'P')
begin
drop procedure sp_pb60pkcheck
end
go
if exists (select 1 from sysobjects
where name = 'sp_pb60fktable' and type = 'P')
begin
drop procedure sp_pb60fktable
end
go
if exists (select 1 from sysobjects
where name = 'sp_pb60foreignkey' and type = 'P')
begin
drop procedure sp_pb60foreignkey
end
go
if exists (select 1 from sysobjects
where name = 'sp_pb60extcat' and type = 'P')
begin
drop procedure sp_pb60extcat
end
go
Top
5 楼george77(F22)回复于 2002-10-23 08:12:50 得分 0
if exists (select 1 from sysobjects
where name = 'sp_pb60procdesc' and type = 'P')
begin
drop procedure sp_pb60procdesc
end
go
if exists (select 1 from sysobjects
where name = 'sp_pb60proclist' and type = 'P')
begin
drop procedure sp_pb60proclist
end
go
if exists (select 1 from sysobjects
where name = 'sp_pb60text' and type = 'P')
begin
drop procedure sp_pb60text
end
go
if exists (select 1 from sysobjects
where name = 'sp_pb60db' and type = 'P')
begin
drop procedure sp_pb60db
end
go
if exists (select 1 from sysobjects
where name = 'sp_pb60helprotect' and type = 'P')
begin
drop procedure sp_pb60helprotect
end
go
if exists (select 1 from sysobjects
where name = 'sp_pb60table' and type = 'P')
begin
drop procedure sp_pb60table
end
go
if exists (select 1 from sysobjects
where name = 'sp_pb60index' and type = 'P')
begin
drop procedure sp_pb60index
end
go
/*------------------------------------------------*/
/* PowerBuilder Client Library Interface */
/* sp_pb60column lists the columns in a table. */
/* The objectid is required as arg1. */
/*------------------------------------------------*/
create proc sp_pb60column
@id int
as
declare @text varchar(255)
select @text = null
select c.colid, c.status, c.type, c.length, c.name, c.usertype,
c.prec, c.scale, @text
from dbo.syscolumns c where c.id = @id and c.cdefault = 0
union select
c.colid, c.status, c.type, c.length, c.name, c.usertype,
c.prec, c.scale, m.text
from dbo.syscolumns c, dbo.syscomments m where c.id = @id
and c.cdefault = m.id and m.colid = 1
order by c.colid
go
if @@error = 0
begin
grant execute on sp_pb60column to public
end
goTop
6 楼george77(F22)回复于 2002-10-23 08:13:13 得分 0
/*------------------------------------------------*/
/* PowerBuilder Client Library Interface */
/* sp_pb60primarykey lists the columns that */
/* comprise the primary key for a table. The */
/* table name is required as arg1. */
/*------------------------------------------------*/
create proc sp_pb60primarykey
@objname varchar(92)
as
declare @objid int /* the object id of the table */
declare @keyname varchar(30) /* name of primary key */
declare @indid int /* the index id of the index */
declare @keycnt smallint /* number of columns in pk */
select @objid = object_id(@objname)
if @objid is null
begin
return 1
end
select @keyname = name,
@indid = indid,
@keycnt = keycnt
from dbo.sysindexes
where id = object_id(@objname) and
indid > 0 and /* make sure it is an index */
(status2 & 2) = 2 and /* make sure declaritive constraint */
(status & 2048) = 2048 /* make sure it is primary key */
if @keycnt is null
begin
return 1
end
/* keycnt contains #clustered key columns but it contains #keys + 1 */
/* for non-clustered indexes. */
if @indid > 1
begin
select @keycnt = @keycnt - 1
end
if @keycnt = 0
begin
return 1
end
select @keyname, @keycnt,
index_col(@objname, @indid, 1),
index_col(@objname, @indid, 2),
index_col(@objname, @indid, 3),
index_col(@objname, @indid, 4),
index_col(@objname, @indid, 5),
index_col(@objname, @indid, 6),
index_col(@objname, @indid, 7),
index_col(@objname, @indid, 8),
index_col(@objname, @indid, 9),
index_col(@objname, @indid, 10),
index_col(@objname, @indid, 11),
index_col(@objname, @indid, 12),
index_col(@objname, @indid, 13),
index_col(@objname, @indid, 14),
index_col(@objname, @indid, 15),
index_col(@objname, @indid, 16)
go
if @@error = 0
begin
grant execute on sp_pb60primarykey to public
end
go
/*----------------------------------------------------*/
/* PowerBuilder Client Library Interface */
/* sp_pb60pkcheck determines whether or not a table */
/* has a Primary Key. Table name is a required arg. */
/*----------------------------------------------------*/
create procedure sp_pb60pkcheck
@objname varchar(92)
as
declare @stat int
select @stat = sysstat2
from dbo.sysobjects
where id = object_id(@objname) and
(sysstat2 & 8) = 8
if (@stat is null)
begin
return (0)
end
else
begin
return (1)
end
go
if @@error = 0
begin
grant execute on sp_pb60pkcheck to public
end
go
/*--------------------------------------------------------------*/
/* PowerBuilder Client Library Interface */
/* sp_pb60fktable lists the tables that reference this table. */
/*--------------------------------------------------------------*/
create procedure sp_pb60fktable
@objname varchar(61) = null
as
declare @objid int
declare @isolevel int /* ptrack 325579 isolation level */
if (@objname is null)
return (1)
select @objid = object_id(@objname)
/* ptrack 325579 override isolation level 0 default */
select @isolevel = @@isolation
if @isolevel = 0
begin
set transaction isolation level 1
end
select o.name, o.id, o.type, o.uid, user_name(o.uid)
from dbo.sysobjects o, dbo.sysreferences r
where r.reftabid = @objid and
r.tableid = o.id
if @isolevel = 0
begin
set transaction isolation level 0
end
go
if @@error = 0
begin
grant execute on sp_pb60fktable to public
end
go
/*-----------------------------------------------------------------*/
/* PowerBuilder Client Library Interface */
/* sp_pb60foreignkey lists all foreign keys associated with */
/* a table whose name is passed as arg1 (required). */
/*-----------------------------------------------------------------*/
create proc sp_pb60foreignkey
@objname varchar(92)
as
declare @objid int /* the object id of the fk table */
declare @keyname varchar(30) /* name of foreign key */
declare @constid int /* the constraint id in sysconstraints */
declare @keycnt smallint /* number of columns in pk */
declare @stat int
declare @isolevel int /* ptrack 325579 isolation level */
select @objid = object_id(@objname)
if (@objid is null)
begin
return (1)
end
select @stat = sysstat2
from dbo.sysobjects
where id = @objid and
(sysstat2 & 2) = 2
if (@stat is null)
begin
return (1)
end
Top
7 楼baoqiangwang(我是一只小小鸟)回复于 2002-10-23 09:00:07 得分 0
估计是数据库重新恢复时,没有恢复该存储过程,检验服务器数据库中是否存在该存储过程Top
8 楼qqqdong()回复于 2002-10-23 09:05:25 得分 0
将PB对数据库的修复执行一下Top
9 楼hxcj(苍松)回复于 2002-10-23 09:25:08 得分 0
问题解决,谢谢各位Top




