Sign in to follow this  
Followers 0
Swarnava

How to create MS Access db which is password protected

2 posts in this topic

I'm working on a project which needs to create a table in my MS access DB each times it runs(It will delete the old table).

Now I need to protect the table with Password to open it.

There is no user interface and password should be written in my code.

Password should be activated when the table created.

User should not be able to view the table data.

There is the code Im using for creating the table.

Func _accessCreateTable($adSource, $adTable, $adCol)

If StringInStr(_accessListTables($adSource), $adTable & '|') Then Return SetError(3,0,0)

If $adCol <> '' Then"

If NOT IsArray($adCol) Then

$adCol = StringSplit($adCol,'|')

EndIf

For $I = 1 To $adCol[0]

If $I <> $adCol[0] Then $adCol[$I] = $adCol[$I] & ' ,'

$F_Out &= $adCol[$I]

Next

EndIf

$oADO = 'ADODB.Connection'

If IsObj($oADO) Then

$oADO = ObjGet('',$oADO)

Else

$oADO = _dbOpen($adSource)

EndIf

If IsObj($oADO) = 0 Then Return SetError(1)

If $F_Out <> '' Then

$oADO.Execute ("CREATE TABLE " & $adTable & '(' & $F_Out & ')');;<<=== Create the table and the columns specified by $adCol

Else

$oADO.Execute ("CREATE TABLE " & $adTable);; <<==== No columns were specified so just create an empty table

EndIf

$oADO.Close()

EndFunc ;<===> _accessCreateTable()

"" THe code is downloded from AutoIt.

I am wating for help.. Thanks.

Share this post


Link to post
Share on other sites



I think I made it much more complicated. Ill give the required part of code which may help you understand more easily..

$oADO = 'ADODB.Connection

$oADO = _dbOpen($adSource)

$oADO.Execute ("CREATE TABLE " & $adTable);; <<==== No columns were specified so just create an empty table

$oADO.Close()

I need to have the password accitaveted

I need to have the password activated when the table is created. Im waiting for this Can any body help on this its really urgent.

Thanks.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0