|
7#
楼主 |
发表于 2006-12-13 12:40:19
|
只看该作者
db_connect("query1","DRIVER={Oracle in ora92};SERVER=ORAC9I;UID=SEDS;PWD=SEDS;DBQ=ORAC9I;DBA=W;APA=T;EXC=F;XSM=Default;FEN=T;QTO=T;FRC=10;FDL=10;LOB=T;RST=T;GDE=F;FRL=Lo;BAM=IfAllSuccessful;MTS=F;MDI=Me;CSR=F;FWC=F;PFC=10;TLO=O;",30);
if(db_connect("query1","DRIVER={Oracle in ora92};SERVER=ORAC9I;UID=SEDS;PWD=SEDS;DBQ=ORAC9I;DBA=W;APA=T;EXC=F;XSM=Default;FEN=T;QTO=T;FRC=10;FDL=10;LOB=T;RST=T;GDE=F;FRL=Lo;BAM=IfAllSuccessful;MTS=F;MDI=Me;CSR=F;FWC=F;PFC=10;TLO=O;",30)==E_OK)
{
report_msg("测试连接成功");
}
else
{
report_msg("测试连接失败!");
}
ddt_open("sysadmin_sys_user",DDT_MODE_READ);
sql="select sysadmin_sys_user.user_no from sysadmin_sys_user where sysadmin_sys_user.user_no='851'";
db_execute_query("query1",sql,recorder_number);
report_msg(recorder_number);
while(recorder_number == 1)
{
if(recorder_number >= 1)
{
report_msg("该会员编码已经存在,产生随机");
srand();
i = 1+int(rand()*1000);
text = sprintf("%s", i);
#text ="xue"&&tmptext; #在这块想实现xue加数字如xue123, 我那样做正确吗?
report_msg(text);
sql="select sysadmin_sys_user.user_no from sysadmin_sys_user where sysadmin_sys_user.user_no='text'";
db_execute_query("ORAC9I",sql,recorder_number);
report_msg(recorder_number);
}
}
if(recorder_number==0)
{
ddt_close(sysadmin_sys_user);
db_disconnect("query1");
if(db_connect("query1","DRIVER={Oracle in ora92};SERVER=ORAC9I;UID=SEDS;PWD=SEDS;DBQ=ORAC9I;DBA=W;APA=T;EXC=F;XSM=Default;FEN=T;QTO=T;FRC=10;FDL=10;LOB=T;RST=T;GDE=F;FRL=Lo;BAM=IfAllSuccessful;MTS=F;MDI=Me;CSR=F;FWC=F;PFC=10;TLO=O;",30)==E_OK)
{
report_msg("关闭连接失败");
}
else
{
report_msg("关闭连接成功!");
}
}
现在有几个问题,大家看看,
1.在while循环中的最后一句report_msg(recorder_number);中得到的数据是0,但实际上在数据库中有那个值;
2.用db_disconnect("query1");数据库断开连接失败!怎么回事啊
3.用text ="xue"&&tmptext; #在这块想实现xue加数字如xue123, 我那样做正确吗? |
|