我的程序运行的是sql sever 7.0,现在要在程序里向informix的一个表插入一行记录。

superneo 2003-03-11 04:25:35
我的程序运行的是sql sever 7.0,现在要在程序里向informix的一个表插入一行记录。
当运行到insert into 语句提示错误:Invalid object name ‘hrstaf0a’

提示:表名没错误


原代码:

transaction my_trans
my_trans=create transaction

string ls_InitFile
ls_InitFile="DB_BSN.ini"

my_trans.DBMS = ProfileString (ls_InitFile, "database", "dbms", "")
my_trans.database = ProfileString (ls_InitFile, "database", "database", "")
my_trans.userid = ProfileString (ls_InitFile, "database", "userid", "")
my_trans.dbpass = ProfileString (ls_InitFile, "database", "databasepassword", "")
my_trans.logid = ProfileString (ls_InitFile, "database", "logid", "")
my_trans.logpass = ProfileString (ls_InitFile, "database", "LogPassWord", "")
my_trans.servername = ProfileString (ls_InitFile, "database", "servername", "")
my_trans.dbparm = ProfileString (ls_InitFile, "database", "dbparm", "")
my_trans.autocommit = False

connect using my_trans;

if my_trans.sqlcode <> 0 then
MessageBox ("Cannot Connect to Database in7", my_trans.sqlerrtext)
return 0
end if


insert into hrstaf0a
(staff_id,Name_chi,Sex,Dept_id,Date_accession,Id_card,status,company_id)
values
("9000","测试1","M","A22","2003-3-11","44010212345101483","A","01")
using my_trans;

if my_trans.sqlcode=0 then
messagebox("","成功")
else
messagebox("","失败")
end if
...全文
41 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
fengzeng 2003-03-12
  • 打赏
  • 举报
回复
试试在程序中select某条数据 using my_trans出来看看,如果能行,insert 应该绝对没问题!
superneo 2003-03-11
  • 打赏
  • 举报
回复
这个表是在informix的,名字没错!

已经想了一整天了,都不知道哪里错了,请大家帮帮忙!
zjyx 2003-03-11
  • 打赏
  • 举报
回复
对象名称无效?hrstaf0a

数据库里有这个表吗??
你到SQL里面运行一下看看行不行

1,075

社区成员

发帖
与我相关
我的任务
社区描述
PowerBuilder 相关问题讨论
社区管理员
  • 基础类社区
  • WorldMobile
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧