如何制作安排程序設定或新建ODBC連接????
不然我只有安裝一個程序自已手動設定ODBC了,苦呀.

解决方案 »

  1.   

    var
       odbcreg:TRegistry;
    begin
      odbcreg:=TRegistry.Create;
         with odbcreg do begin
            RootKey:=HKEY_LOCAL_MACHINE;
            if OpenKey('SOFTWARE\ODBC\ODBC.INI\ODBC Data Sources',true) then begin
               WriteString( 'CONFI_MRPII', 'Microsoft Visual Foxpro Driver' );
               CloseKey;
               if OpenKey('SOFTWARE\ODBC\ODBC.INI\CONFI_MRPII',true) then begin
                  WriteString('Driver','vfpodbc.dll');
                  WriteString('SourceDB','c:\ss.dbc');
                  WriteString('Description','CONFI_MRPII');
                  WriteString('SourceType','DBC');
                  WriteString('BackgroundFetch','Yes');
                  WriteString('Exclusive','No');
                  WriteString('Null','Yes');
                  WriteString('Deleted','Yes');
                  WriteString('Collate','Machine');
                  WriteString('SetNoCountOn','No');
                  CloseKey;
                  showmessage('VFPODBC datasource create ok');
              end;
            end;
          end;
    end;
      

  2.   

    var
       odbcreg:TRegistry;
    begin
      odbcreg:=TRegistry.Create;
         with odbcreg do begin
            RootKey:=HKEY_LOCAL_MACHINE;
            if OpenKey('SOFTWARE\ODBC\ODBC.INI\ODBC Data Sources',true) then begin
               WriteString( 'CONFI_MRPII', 'Microsoft Visual Foxpro Driver' );
               CloseKey;
               if OpenKey('SOFTWARE\ODBC\ODBC.INI\CONFI_MRPII',true) then begin
                  WriteString('Driver','vfpodbc.dll');
                  WriteString('SourceDB','c:\ss.dbc');
                  WriteString('Description','CONFI_MRPII');
                  WriteString('SourceType','DBC');
                  WriteString('BackgroundFetch','Yes');
                  WriteString('Exclusive','No');
                  WriteString('Null','Yes');
                  WriteString('Deleted','Yes');
                  WriteString('Collate','Machine');
                  WriteString('SetNoCountOn','No');
                  CloseKey;
                  showmessage('VFPODBC datasource create ok');
              end;
            end;
          end;
    end;
      

  3.   

    var
       odbcreg:TRegistry;
    begin
      odbcreg:=TRegistry.Create;
         with odbcreg do begin
            RootKey:=HKEY_LOCAL_MACHINE;
            if OpenKey('SOFTWARE\ODBC\ODBC.INI\ODBC Data Sources',true) then begin
               WriteString( 'CONFI_MRPII', 'Microsoft Visual Foxpro Driver' );
               CloseKey;
               if OpenKey('SOFTWARE\ODBC\ODBC.INI\CONFI_MRPII',true) then begin
                  WriteString('Driver','vfpodbc.dll');
                  WriteString('SourceDB','c:\ss.dbc');
                  WriteString('Description','CONFI_MRPII');
                  WriteString('SourceType','DBC');
                  WriteString('BackgroundFetch','Yes');
                  WriteString('Exclusive','No');
                  WriteString('Null','Yes');
                  WriteString('Deleted','Yes');
                  WriteString('Collate','Machine');
                  WriteString('SetNoCountOn','No');
                  CloseKey;
                  showmessage('VFPODBC datasource create ok');
              end;
            end;
          end;
    end;
      

  4.   

    http://218.56.11.178:8020/web/technology/dabao.htm
      

  5.   

    http://218.56.11.178:8020/web/technology.aspx->应用程序打包问题的解决方案 
     Wise打包工具的使用事例