Using the below ADO codeing to connect MSAceess , I want to give password to MSAccess file to protect unauthorised access from users .
if I am giveing password to MSAccess file using its security option , I can't connect to MSAccess from VB 6.0 , in the below codeing where can I give password , or I want to change my codeing ..
Public cn As ADODB.Connection
Public rs As ADODB.Recordset
Public cmd As ADODB.Command
Set cn = New ADODB.Connection
constr = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\shalimardbs.mdb;Persist Security Info=false"
Set cmd = New ADODB.Command
Set cmd.ActiveConnection = cn
dc.cmd.CommandText = "SELECT ITEMNAME,WEIGHT From STOCKREGISTER WHERE ITEMCODE =ANY (SELECT ITEMCODE FROM PREPARATIONCHART WHERE DISHCODE = 'D001' ) ORDER BY ITEMCODE "
Set dc.rs = New ADODB.Recordset
Set dc.rs = dc.cmd.Execute