Have A question want to consult everybody, existing A Access database is A by A program to regularly write data in the form of monopoly, now I want to write A c # program B to read-only Access to the database file, I don't need to edit, update, etc., only need to read the data inside, excuse me each bosses, this can be achieved, c # program to connect to the database of the string and how to write? Online, wait! thank you
CodePudding user response:
Read only roles and then build procedure for the database B in that role
CodePudding user response:
The DataTable Access (string comand) { String strConn="Provider=Microsoft. ACE. The OLEDB. 12.0; Data source=C: \ \ Users \ \ 2019 \ \ XXXX accdb; Persist Security Info=False "; The DataTable dt=new DataTable (); OleDbConnection conn=new OleDbConnection (strConn); Conn. The Open (); OleDbDataAdapter myCommand=new OleDbDataAdapter (comand, strConn);
MyCommand. The Fill (dt); Conn. Close (); Return dt. }