同题

解决方案 »

  1.   

    把ini文件的值赋给全局变量,再通过全局变量设置。
      

  2.   

    按DELPHI的帮助文件说明,如下两个语句可以取外部的INI,可没作用,不知为何
    .LoadParamsOnConnect:=True;
    .LoadParamsFromIniFile('dbxConnections.ini');
      

  3.   

    首先把params里面的内容保存下来然后程序中
    sqlconnect.params.loadfromfile('xxxxx');
      

  4.   

    请问文件里的内容如何写呢,是不是如下
    DriverName=MSSQL
    HostName=SERVER9
    DataBase=BTM
    User_Name=sa
    Password=
    BlobSize=-1
    ErrorResourceFile=
    LocaleCode=0000
    MSSQL TransIsolation=ReadCommited
    OS Authentication=False
    谢谢
      

  5.   

    在想请问一下, DBEXPRESS 发布的时候要注意哪些问题,请指教,谢谢
      

  6.   

    对!
    比如起个名字叫做 dbconfig.iniSQLConnection.LoadParamsOnConnect 要变成false;因为它是去读那个dbxConnection.ini。然后在适当的地方
    SQLConnection.Params.LoadFromFile('dbconfig.ini');
    SQLConnection.Connectioned:= true;
      

  7.   

    没什么可以注意的,只要一同发布相关的2个DLL文件就行了。
      

  8.   

    方法2:
    在配置文件中(文件名如:MSSQLConfig.ini)
    [MSSQLConfig]
    DriverName=MSSQL
    HostName=192.168.0.67
    DataBase=NorthWind
    User_Name=Meter
    Password=Meter
    BlobSize=-1
    LocaleCode=0000
    MSSQL TransIsolation=ReadCommited
    OS Authentication=False
    在某个事件中如TForm.Show中写入如下代码:
    var
      Ini_MSSqlConfig : TIniFile;
      ADDIni : TStringList;
      PathStr : String;
      BeforTime : Real;
      TotalTime : Real;
    begin
      ADDIni := TStringList.Create;
      PathStr := ExtractFilePath(Application.ExeName) + 'MSSQLConfig.ini';
      Try
        Ini_MSSqlConfig := TIniFile.Create(PathStr);
        (******************必须在前************************)
        DBExpressDM.SQLConnection1.ConnectionName := 'YeaFirst';
        {******************必须在前************************}
        Ini_MSSqlConfig.ReadSectionValues('MSSQLConfig',ADDIni);
        DBExpressDM.SQLConnection1.Params.AddStrings(ADDIni);
        {*****************必须要的配置**********************}
        DBExpressDM.SQLConnection1.DriverName := 'MSSQL';
        DBExpressDM.SQLConnection1.GetDriverFunc:= 'getSQLDriverMSSQL';
        DBExpressDM.SQLConnection1.LoginPrompt := false;
        DBExpressDM.SQLConnection1.VendorLib := 'oledb';
        DBExpressDM.SQLConnection1.LibraryName := 'dbexpmss.dll';
        {*****************必须要的配置**********************}
        BeforTime := GetTickCount;
        DBExpressDM.SQLConnection1.Connected := true;
        TotalTime := (GetTickCount - BeforTime)/1000.0;
        self.Caption := '打开MSSQL2000耗时'+FloatToStr(TotalTime)+'秒!';
        DBExpressDM.SQLQuery1.SQLConnection := DBExpressDM.SQLConnection1;
        DBExpressDM.SQLQuery1.Active := false;
        DBExpressDM.SQLQuery1.SQL.Clear;
        DBExpressDM.SQLQuery1.SQL.Add('Select * From Orders
                 order by CustomerID DESC');
        DBExpressDM.SQLQuery1.Active := true;
      Finally
        Ini_MSSqlConfig := Nil;
        Ini_MSSqlConfig.Free;
        ADDIni.Clear;
        ADDIni.Free;
      End;
    end;
    我想你自己再在你自己的程序中做适合你自己的一些修改就可以了。
    本程序已经调试成功的。
      

  9.   

    发布时特别要注意几个DLL
    就是EXPRESS所支持数据库的动态库
      

  10.   

    我在程序里按2方法做了,但DEBUG说TINIT未声明.