Jump to content

How to create MS Access db which is password protected


Recommended Posts

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.

Link to comment
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.

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...