您的位置:程序门 -> delphi -> 数据库相关



测试点击软件时能上传数据,使用电脑启动软件却不能上传数据?


[收藏此页] [打印本页]选择字色:背景色:字体:[][][]


测试点击软件时能上传数据,使用电脑启动软件却不能上传数据?[已结贴,结贴人:]
发表于:2007-06-18 17:04:22 楼主
我制作一个软件,每2分钟自动上传一次数据,我测试的时候没有问题,但是,我将软件加到注册表的run里面启动软件的时候,软件2分钟后没有任何反应,奇怪,以下是我程序的代码,请高手看看,谢谢!

procedure   tc_form.up_timertimer(sender:   tobject);
var
    f   :   textfile   ;
    s   :   string;
    i   :   integer   ;
    s_title   ,   s_process   ,   s_times   :   string   ;
begin
{$region   'show_memo信息上传到服务器 '}
      if   show_memo.text   <>   ' '   then
          begin
              try
                    server_adoconnection.connected   :=   true;

                    for   i   :=   0   to   show_memo.lines.count   -   1   do
                        begin
                        s_title   :=   ' ';
                        s_process   :=   ' ';
                        s_times   :=   ' ';

                        if   show_memo.lines.strings[i]   <>   ' '   then
                            begin
                            //解析数据
                              s_title   :=   copy(show_memo.lines.strings[i],1,9)   ;       //解析出   s_title
                              s_process   :=   copy(show_memo.lines.strings[i],11,length(trim(show_memo.lines.strings[i]))   -   30)   ;       //解析出   s_process
                              s_times   :=   copy(show_memo.lines.strings[i],length(trim(show_memo.lines.strings[i]))   -   18,19   )   ;       //解析出   s_times

                    with   server_adoquery   do   begin
                        close;
                        sql.clear;
                        sql.add( 'select   *   from   process_show_table ');
                        open;
                        insert;   //解析后上传到服务器
                        fields.fieldbyname( 'title ').asstring   :=   trim(s_title)   ;
                        fields.fieldbyname( 'process ').asstring   :=   trim(s_process)   ;
                        fields.fieldbyname( 'times ').asstring   :=   trim(s_times)   ;
                        fields.fieldbyname( 'ipad ').asstring   :=   trim(computer_ipad);
                        post;
                    end;
                            end;
                        end;

                        show_memo.clear;

              except

              end;
          end;

{$endregion}
end;
发表于:2007-06-18 17:07:361楼 得分:0
1.sqlserver服务尚未启动。你需要等待服务完全启动。


快速检索

最新资讯
热门点击