请问各位高手,我创建一个窗体,在其上放一个BUTTON控件和EDIT控件,EDIT用于输入数据名,用的是DELPHI与SQL-SERVER数据库,再创建一个窗体FORM2,在其上放QREPORT控件用于制作报表的,当我单击FORM1的BUTTON控件时,就能显示出EDIT中数据库中的数据内容,代码如下:
form2.adoquery1.connectionstring:='';
form2.adoquery1.connectionstring:='Provider=SQLOLEDB.1;Persist Security Info=False;User ID=sa;Initial Catalog=american';
form2.adotable1.connectionstring:='';
form2.adotable1.connectionstring:='Provider=SQLOLEDB.1;Persist Security Info=False;User ID=sa;Initial Catalog=american' ;
form2.adotable1.tablename:='t_bus';
form2.adotable1.open;
form2.qrdbtext1.datafield:='c_ch';
application.createform(tform2,form2);
form2.quickrep1.preview;
不知错在哪里,不能显示出数据,如何改正,如何写代码,请指教
form2.adoquery1.connectionstring:='';
form2.adoquery1.connectionstring:='Provider=SQLOLEDB.1;Persist Security Info=False;User ID=sa;Initial Catalog=american';
form2.adotable1.connectionstring:='';
form2.adotable1.connectionstring:='Provider=SQLOLEDB.1;Persist Security Info=False;User ID=sa;Initial Catalog=american' ;
form2.adotable1.tablename:='t_bus';
form2.adotable1.open;
form2.qrdbtext1.datafield:='c_ch';
application.createform(tform2,form2);
form2.quickrep1.preview;
不知错在哪里,不能显示出数据,如何改正,如何写代码,请指教
解决方案 »
- 谁有支持fastreport 2.5的TfrMoneyView控件?
- IdTCPClient取消接受文件后,IdTCPServer死掉了,请问怎么解决。
- 大家帮我看看,这段代码那里出错了,打印的时候出现很奇怪的问题,
- MDI子窗体覆盖了主窗体的工具栏
- 东进语音卡录音模块的delphi问题
- delphi调用拨号网络问题
- 问个简单问题,我做一个循环,for i:=0 to ListBox.ItemCount-1 do...
- forgot2000的散分帖,同时有两件事给大家说一下。
- 关于ActivexForm的调用
- 如何在NT下关机?
- 如何访问内网
- stringgrid打印预览,却看不到。请朋友们诊断诊断是怎么回事?
form2.adoquery1.connectionstring:='Provider=SQLOLEDB.1;Persist Security Info=False;User ID=sa;Initial Catalog=american';
form2.adotable1.connectionstring:='';
form2.adotable1.connectionstring:='Provider=SQLOLEDB.1;Persist Security Info=False;User ID=sa;Initial Catalog=american' ;
form2.adotable1.tablename:='t_bus';
form2.adotable1.open;
form2.qrdbtext1.datafield:='c_ch';
form2.quickrep1.preview;