如何读取ACCESS数据库文件*.mdb的头文件前16字节的信息?并且能够显示出来,然后在以另外的信息写入进去?

解决方案 »

  1.   

    OpenFile 然后读取,也可以写入
    看看帮助
      

  2.   

    用流直接对文件读取好了(stream)
      

  3.   

    to snfa2002(不为人杰誓不休) 
    具体是怎样?能举个例子吗?
      

  4.   

    大概过程如下:procedure  tform1.EncrypMDB(filename:string);  //用titlestr2内容替换MDB前16个字节,以便实现加密的作用  
    var  F:TFileStream;  
    begin  
         if  not  fileExists(filename)  then  exit;  
             F:=TFileStream.create(filename,fmopenwrite);  
             try  
                 F.seek($00,soFromBeginning);  
                 F.Write(titlestr2,16);  
             finally  
                 F.free;  
             end;  
    end;  
    procedure  tform1.uncrypMDB(filename:string);  //还原MDB前16个字节  
    var  F:TFileStream;    //文件流  
    begin  
         if  not  fileExists(filename)  then  exit;  
             F:=TFileStream.create(filename,fmopenwrite);  
             try  
                 F.seek($00,soFromBeginning);   
                 F.Write(titlestr,16);   
             finally  
                 F.free;  
             end;  
    end;
      

  5.   

    读出来
    var
        F:TFileStream;
        passBuf:array[0..49]of byte;
        I:INTEGER;
    begin
    memo1.Clear;
       if not FileExists(Edit1.Text) then exit;
       F:=TFileStream.Create(Edit1.Text,fmOpenRead);
       try
         F.Seek($42,soFromBeginning);
         F.Read(passBuf,50);
       finally
         F.Free;
       end;
    for i:=0 to 49 do
        memo1.lines.add(VarToStr(inttohex(passBuf[i],2)));
    end;
    再写进去的问题
    将上面的read改为write,
       F:=TFileStream.Create(Edit1.Text,fmOpenwrite);