Home > Back-end >  Consult everybody, how to link the access stand-alone database
Consult everybody, how to link the access stand-alone database

Time:09-17

Units to make up a stand-alone version of the small program, a 64 - bit system + 64 office + delphi7, need to use the access database, using adoconnection a connection error, how to do ah, consult everybody, thank you!

CodePudding user response:

64 office?

CodePudding user response:

 
A, the use of ADO controls
ADOCommand: TADOCommand;
ADOCon: TADOConnection;
ADOQuery1: TADOQuery;
ADOTable1: TADOTable;
DataSource1: TDataSource;
To establish connections between control,

Second, connection code

DataName:='XX database;
The ConnectionString:='. The Provider=Microsoft Jet. The OLEDB. 4.0. + '
'the User ID=admin; '+//user ID
'Data Source=' + DataName + ';
'+//database file'Mode=Share Deny None; + '
'the Jet OLEDB: Database Password=lyhoo;
'+//password'Jet OLEDB: SFP=False;
ADOCon. Connected:=False;
ADOCon. The ConnectionString:=the ConnectionString;
ADOCon. Connected:=True;

Three, according to
Through ADOQuery1 ADOTable1 access,

CodePudding user response:

Architecture do not match, both 32-bit and 64 - bit does not match?

CodePudding user response:

I generally is to Access database file save as 2003 version of the MDB file, and then directly with AdoConnection configuration connection, generally will be successful

CodePudding user response:

Are you Access database file suffix is what? The MDB or accdb? Or join method, mainly is the Provider of values are not consistent,

CodePudding user response:

Conn. Connected:=false;

Conn. The ConnectionString:='. The Provider=Microsoft Jet. The OLEDB. 4.0; The Data Source=c: \ test. The MDB; Persist Security Info=False; The Jet OLEDB: Database Password=123456 ';
Try
Conn. Connected;
Except,
Showmessage (' links database file error, ');
exit;
end;
  • Related