当前位置:首页
开发技术指南» 文章正文
    引言:
 

 

    摘要: 一定要经典哟!!! ......
    摘要: 在一个通过代理服务器上网的主机中建立了一个ucp服务,知道主机的信息(mac,ucp端口,内部ip,等),如何在外部把一个ucp数据发送给这个服务??就象qq一样。 给出原理给50 , 如给出范例,另外给分!!有范例的用email:cyh.yiheng@163.com ......


为什么这样做游标仍然多输出一行

fetch   emp_w   into   :order_name;  
  do   while   sqlca.sqlcode=0  
              ddlb_1.additem(order_name)  
              fetch   emp_w   into   :order_name;  
  loop

NO.1   作者: fengzeng

建议在程序中尽量避免使用游标,我有如下例程也许会对你有用:  
  //f_create_datastorenew  
  //ddlb_tmp 添加数据  
  //as_disp_table 显示列表名  
  //as_colname 显示数据列  
  //as_rtn_table 返回列表名  
  //as_rtn_colname 选取时返回值对应的列  
  //as_sql 生成DATASTORE的语法  
  //as_data[] 返回值  
   
  string   error_syntaxfromSQL,   error_create  
  string   new_sql,   new_syntax,ls_text,ls_coltype,ls_type  
  string   ls_colname,ls_rtn  
  DataStore   lds_data  
  Long   i,ll_col  
   
  lds_data   =   Create   DataStore  
   
  new_syntax   =   SQLCA.SyntaxFromSQL(as_sql,   &  
  Style(Type=Form),   error_syntaxfromSQL)  
   
  IF   Len(error_syntaxfromSQL)   >   0   THEN  
  //   Display   errors  
  MessageBox("提示信息",   "语法错误"+error_syntaxfromSQL)  
  return   -1  
  ELSE  
  //   Generate   new   DataWindow  
  lds_data.Create(new_syntax,   error_create)  
  IF   Len(error_create)   >   0   THEN  
  MessageBox("提示信息",   "语法错误"+error_create)  
  return   -1  
  END   IF  
  END   IF  
   
  lds_data.SetTransObject(SQLCA)  
  if   lds_data.Retrieve()   =   0   then   return   0  
  ddlb_tmp.SetRedraw(false)  
  ddlb_tmp.Reset(   )  
  if   as_disp_table   <>   ""   then  
  ls_colname   =   as_disp_table+"_"+as_colname  
  else  
  ls_colname   =   as_colname  
  end   if  
  if   as_rtn_table   =   ""   then  
  ls_rtn   =   as_rtn_colname  
  else  
  ls_rtn   =   as_rtn_table+"_"+as_rtn_colname  
  end   if  
  FOR   i   =   1   TO   lds_data.RowCount()  
   
  ls_text   =   lds_data.GetItemString(i,ls_colname)  
  //获取列的数据类型  
  ls_coltype   =   lds_data.describe(ls_rtn+".coltype")  
  ls_type   =   upper(left(ls_coltype,3))  
  choose   case   ls_type  
  case   LON,INT,NUM,REA,ULO  
  as_data[i]   =   STRING(lds_data.getitemnumber(   i,   ls_rtn))  
  case   DEC  
  as_data[i]   =   String(lds_data.GetItemDecimal(i,ls_rtn))  
  case   CHA  
  as_data[i]   =   lds_data.getitemstring(   i,   ls_rtn)  
  case   DAT  
  as_data[i]   =   STRING(lds_data.getitemDATETIME(   i,   ls_rtn))  
  case   TIM  
  as_data[i]   =   STRING(lds_data.getitemTIME(   i,   ls_rtn))  
  end   choose  
   
  ddlb_tmp.additem(ls_text)  
  NEXT  
  ddlb_tmp.SetRedraw(true)  
  Destroy   lds_data;  
  return   1

NO.2   作者: callingda

程序有问题,应改为:    
   
  do    
              fetch   emp_w   into   :order_name;  
              if   sqlca.sqlcode   =   0   then  
                    ddlb_1.additem(order_name)  
              end   if  
  loop   while   sqlca.sqlcode=0  
   
 

NO.3   作者: lvjunyu

fetch   emp_w   into   :order_name;  
  do   while   sqlca.sqlcode   <>   100  
              ddlb_1.additem(order_name)  
              fetch   emp_w   into   :order_name;  
  loop  
 


    摘要: 网上一直在说asp。net很简单,容易学,但我看了一段时间,感觉并不是大学所说的那么简单,asp好象还好学一点,是不是因为我对asp有先入为主,所以学asp。net有点难。给点意见,如果真的简单,告诉我如何下手吧,难的话,我就不学它了,把asp加深就行了 ......
» 本期热门文章:

©2000-2007 All Rights Reserved. 最佳浏览:1024X768 MSIE