如题,解决这个问题就加一百分!

解决方案 »

  1.   


    直接打开文件,进行修改即可,下面是解密的原码,可以很容易看出其加密原理的,反过来就可以写出修改密码的程序,不用我写了吧~~~implementation
    uses selfFunc;
    {$R *.DFM}
    var f : integer;
       ss : array[0..12] of byte=($86, $FB, $EC, $37, $5D, $44,
    $9C, $FA, $C6, $5E, $28, $E6, $13);
    procedure TForm1.BitBtn1Click(Sender: TObject);
    var   password :array[0..12] of char;
          buff :array[0..12] of byte;
        i:integer;
    begin    f := FileOpen(Edit1.Text,fmOpenRead);  if f=-1 then
      begin
        msgBox('文件不能打开!');
        Exit;
      end;
       FileSeek(f,66,0);
       FileRead(f,buff,13);
       for i:=0 to 12 do
       if buff[i]<>0 then
        password[i] := Char(buff[i] xor ss[i]);
       Edit2.Text := password;  //edit2.text就是解密后的密码
       FileClose(f);
    end;97 ok 2000 no
      

  2.   

    回复人: hwkknd(白开水) 
    我这有段代码,但我没改密码,是做压缩修复用的,用的是CompactDateBase这个方法,虽然用它改密码有点绕弯,但可以实现。给你参烤一下吧!procedure TMainForm.N10Click(Sender: TObject);
    var dao:OLEVariant;
    DBName,tempDBName:String ;
    begin
     DBBK:= TDBBK.Create(self);
     DBBK.Panel2.Caption := '正在优化数据库……' ; DBBK.show ;
     DBBK.Panel2.Update ;
     DBName:= ExtractFilePath(ParamStr(0))+'data\Accountmanage.mdb';
     tempDBName:= ExtractFilePath(ParamStr(0))+'data\tempAccountmanage.mdb';
     DM.ADOcon.Close;
     Screen.Cursor:=CrHourGlass;
     sleep(1000);
     Try
     dao:=createOleObject('DAO.DBEngine.36');
     Dao.CompactDataBase(DBName,tempDBName,,,';pwd=123456');
     DeleteFile(DBName);
     RenameFile(tempDBName,DBName);
     finally
     Screen.Cursor:=CrDefault;
     dao:=null;
     DM.ADOcon.Open;
     DBBK.Close ;
     DBBK.Free ;
     DBBK:= Nil ;
     end;
     messagedlg('数据库优化完成!',mtinformation,[mbok],0) ;
    end;
      

  3.   


    还有help
    CompactDatabase Method
             Copies and compacts a closed database, and gives you the option of changing its version, collating order, and encryption. (Microsoft Jet workspaces only).SyntaxDBEngine.CompactDatabase olddb, newdb, locale, options, passwordThe CompactDatabase method syntax has these parts.Part Description 
    olddb A String that identifies an existing, closed database. It can be a full path and file name, such as "C:\db1.mdb". If the file name has an extension, you must specify it. If your network supports it, you can also specify a network path, such as "\\server1\share1\dir1\db1.mdb". 
    newdb A String that is the file name (and path) of the compacted database that you're creating. You can also specify a network path. You can't use the newdb argument to specify the same database file as olddb. 
    locale Optional. A Variant that is a string expression that specifies a collating order for creating newdb, as specified in Settings. If you omit this argument, the locale of newdb is the same as olddb. 
     You can also create a password for newdb by concatenating the password string (starting with ";pwd=") with a constant in the locale argument, like this: 
     dbLangSpanish & ";pwd=NewPassword" 
     If you want to use the same locale as olddb (the default value), but specify a new password, simply enter a password string for locale: 
     ";pwd=NewPassword" 
    options Optional. A constant or combination of constants that indicates one or more options, as specified in Settings. You can combine options by summing the corresponding constants. 
    password Optional. A Variant that is a string expression containing a password, if the database is password protected. The string ";pwd=" must precede the actual password. If you include a password setting in locale, this setting is ignored. SettingsYou can use one of the following constants for the locale argument to specify the CollatingOrder property for string comparisons of text.Constant Collating order 
    dbLangGeneral English, German, French, Portuguese, Italian, and Modern Spanish 
    dbLangArabic Arabic 
    dbLangChineseSimplified Simplified Chinese 
    dbLangChineseTraditional Traditional Chinese 
    dbLangCyrillic Russian 
    dbLangCzech Czech 
    dbLangDutch Dutch 
    dbLangGreek Greek 
    dbLangHebrew Hebrew 
    dbLangHungarian Hungarian 
    dbLangIcelandic Icelandic 
    dbLangJapanese Japanese 
    dbLangKorean Korean 
    dbLangNordic Nordic languages (Microsoft Jet database engine version 1.0 only) 
    dbLangNorwDan Norwegian and Danish 
    dbLangPolish Polish 
    dbLangSlovenian Slovenian 
    dbLangSpanish Traditional Spanish 
    dbLangSwedFin Swedish and Finnish 
    dbLangThai Thai 
    dbLangTurkish Turkish You can use one of the following constants in the options argument to specify whether to encrypt or to decrypt the database while it's compacted.Constant Description 
    dbEncrypt Encrypt the database while compacting. 
    dbDecrypt Decrypt the database while compacting. If you omit an encryption constant or if you include both dbDecrypt and dbEncrypt, newdb will have the same encryption as olddb.You can use one of the following constants in the options argument to specify the version of the data format for the compacted database. This constant affects only the version of the data format of newdb and doesn't affect the version of any Microsoft Access-defined objects, such as forms and reports.Constant Description 
    dbVersion10 Creates a database that uses the Microsoft Jet database engine version 1.0 file format while compacting. 
    dbVersion11 Creates a database that uses the Microsoft Jet database engine version 1.1 file format while compacting. 
    dbVersion20 Creates a database that uses the Microsoft Jet database engine version 2.0 file format while compacting. 
    dbVersion30 Creates a database that uses the Microsoft Jet database engine version 3.0 file format (compatible with version 3.5) while compacting. You can specify only one version constant. If you omit a version constant, newdb will have the same version as olddb. You can compact newdb only to a version that is the same or later than that of olddb.ResAs you change data in a database, the database file can become fragmented and use more disk space than is necessary. Periodically, you can use the CompactDatabase method to compact your database to defragment the database file. The compacted database is usually smaller and often runs faster. You can also change the collating order, the encryption, or the version of the data format while you copy and compact the database.You must close olddb before you compact it. In a multiuser environment, other users can't have olddb open while you're compacting it. If olddb isn't closed or isn't available for exclusive use, an error occurs.Because CompactDatabase creates a copy of the database, you must have enough disk space for both the original and the duplicate databases. The compact operation fails if there isn't enough disk space available. The newdb duplicate database doesn't have to be on the same disk as olddb. After successfully compacting a database, you can delete the olddb file and rename the compacted newdb file to the original file name.The CompactDatabase method copies all the data and the security permission settings from the database specified by olddb to the database specified by newdb.If you use CompactDatabase to convert a version 1.x database to version 2.5 or 3.x, only applications using version Microsoft Jet 2.5 or 3.x can open the converted database.Note   In an ODBCDirect workspace, using the CompactDatabase method doesn't return an error, but instead loads the Microsoft Jet database engine into memory.Caution   Because the CompactDatabase method doesn't convert Microsoft Access objects, you shouldn't use CompactDatabase to convert a database containing such objects. To convert a database containing Microsoft Access objects, on the Tools menu, point to Database Utilities, and then click Convert Database.
      

  4.   

    用access内嵌的vb可以改,不知道delphi怎么做
      

  5.   

    如果你用BDE连接的话,那么用BDE的API就可以实现。
      

  6.   

    或者按照MSDN的说明,用下面的语句,具体的使用你可以查看http://www.microsoft.com/china/msdn/archives/library/dnacc2k2/html/odc_acsecurity.asp#odc_acsecurity_password通过编程设置数据库密码
    按以下语法使用关键字 ALTER DATABASE,您可以编程设置、修改或删除数据库密码。ALTER DATABASE PASSWORD NewPassword OldPassword