他趴在我两腿中间吸我视频_久久综合色之久久综合_久久久久无码精品国产_欧美丰满大乳高跟鞋_国产精品伦一区二区三级视频_综合色就爱涩涩涩综合婷婷_国产人妻人伦精品熟女_人人妻人人澡人人爽久久AV_欧洲美女与动zooz_国产免费午夜A无码V视频

以文本方式查看主題

-  曙海教育集團(tuán)論壇  (http://www.mikehunterok.com/bbs/index.asp)
--  Delphi程序設(shè)計(jì)  (http://www.mikehunterok.com/bbs/list.asp?boardid=76)
----  幾個(gè)delphi書(shū)中沒(méi)提過(guò)的數(shù)據(jù)庫(kù)問(wèn)題與我的疑惑和心得(一起討論)  (http://www.mikehunterok.com/bbs/dispbbs.asp?boardid=76&id=2570)

--  作者:wangxinxin
--  發(fā)布時(shí)間:2010-12-14 11:16:27
--  幾個(gè)delphi書(shū)中沒(méi)提過(guò)的數(shù)據(jù)庫(kù)問(wèn)題與我的疑惑和心得(一起討論)

1,ADOConnection和ADOTable在delphi中的使用

ADOConnection和ADOTable在delphi中像許多書(shū)中教的那樣設(shè)置好連接上數(shù)據(jù)庫(kù)(我用的SQLServer),運(yùn)行沒(méi)有問(wèn)題。然后我修改,目的是可以修改連接數(shù)據(jù)庫(kù)而不用在delphi中修改ADOConnection的ConnectionString屬性,還不出現(xiàn)連接對(duì)話框。

修改步驟:將LoginPrompt設(shè)置為false,將ConnectionString屬性清空,添加連接代碼

conStr:=\'Provider=SQLOLEDB.1;Password=1982072019;User ID=sa;Initial Catalog=StorageManagement;Data Source=10.16.99.175\';
  try
    loginForm.tempADOConnection.ConnectionString :=conStr;
    loginForm.tempADOConnection.Connected := true;
  except
    messagedlg(\'數(shù)據(jù)庫(kù)連接有誤!!請(qǐng)檢查DataConfig.XML\',mtConfirmation,[mbOk],0);
    Application.Terminate;
  end;

這樣程序運(yùn)行起來(lái),連接數(shù)據(jù)庫(kù)是沒(méi)有問(wèn)題的。但出現(xiàn)的問(wèn)題是在dlephi中ADOTable控件是不能連接表的,因?yàn)镃onnectionString屬性沒(méi)有值。報(bào)錯(cuò)為“無(wú)效的授權(quán)說(shuō)明”。如何既能在delphi中使用ADOConnection和ADOTable控件,又可以不出現(xiàn)那個(gè)討厭的連接對(duì)話框。

2,在delphi中使用sql語(yǔ)句。

因?yàn)閟ql語(yǔ)句中給字符串賦值需要用雙引號(hào),而delphi中用單引號(hào)括起字符串,我使用遇到了一些問(wèn)題。我試驗(yàn)的結(jié)果是delphi中用兩個(gè)單引號(hào)代替sql語(yǔ)句中的雙引號(hào)。不知道對(duì)不對(duì)?

具體如何使用,我還是不太清楚。

3,在delphi 7.0中使用ADOQuery的返回結(jié)果,書(shū)中介紹使用Params[\'xxxx\'].AsString;

我使用后報(bào)錯(cuò),但有一個(gè)光盤(pán)的程序這樣使用沒(méi)有報(bào)錯(cuò)。我使用的是Parameters[\'xxxx\'],也使用不了.AsString

4,原代碼:
====================================================================
if canInsert then
  begin
    with allDataModule.AQ_OtherMaterielOut do
    begin
      Close;
      SQL.Clear;
      SQL.Text:=\'insert otherMaterielOut(materielID,amount) values (:insertID,:insertAmount,)\';
      Parameters[0].Value:=myMateriel;
      Parameters[1].Value:=myAmount; 
      ExecSQL;
    end;
    with allDataModule.AQ_OtherMaterielStock do
    begin
      Close;
      SQL.Clear;
      SQL.Text:=\'update otherMaterielStock set amount=amount-:updateAmount where materielID=:updateID\';
      Parameters[0].Value:=myAmount;
      Parameters[1].Value:=myMateriel;
      ExecSQL;
    end;
    materielOutForm.Close;
  end;

在這段代碼之后
with allDataModule.AQ_OtherMaterielOut do
    begin
      Close;
      SQL.Clear;
      SQL.Text:=\'update otherMaterielStock set amount=amount-:updateAmount where materielID=:updateID\';
      Parameters[0].Value:=myAmount;
      Parameters[1].Value:=myMateriel;
      ExecSQL;
    end;

不能使用allDataModule自動(dòng)顯示可以使用的控件列表功能,但我強(qiáng)加上后面的代碼仍然可以使用。怎么回事?