Hi there,

I'm currently rewriting an old VB 6 (stand alone) application in VB .Net
2003 in which users can create MS Access databases. In the new version I
want to add security options like encrypting the database, adding users and
groups etc.

I managed to create MS access databases and tables using ADOX, but I can't
add users and groups to it. I use the following code:

Dim myCat as New ADOX.Catalog
Dim myCon as OleDb.OleDbConnection
Dim myConStr as String
Dim myNewUser as ADOX.User
Dim myNewGroup as ADOX.Group

Try
myConStr = "Provider=Microsoft.Jet.OLEDB.4.0; Jet oledb:system
database=system.mdw;" & _
"Data Source=C:\Test.mdb"
'Creating the database
myCat.Create(myConStr)
myCon = New OleDb.OleDbConnection(myConStr)
myCon.Open()

myCat.ActiveConnection = myCon <<-- This seems to be the problem
after debugging the code

'Creating a new group
myCat.Groups.Append("User group")
'Creating a new user
myNewUser = New ADOX.User
myNewUser.Name = "Jan Janssen"
myCat.Users.Append(myNewUser)
'Add new user to the new group
myNewUser.Groups.Append("User Group")

myCon.Close()
myCat = Nothing
myCon = Nothing
Catch ex as Exception
MessageBox.Show(ex.Message)
End Try

When executing this code the following error occurs: "Interface not
supported"

Can anyone help me out or is there an alternative approach without using SQL
servers?

thnx

RE: MS Access problems by VenkatKL

VenkatKL
Fri Nov 25 09:24:02 CST 2005

Hi Dear Jan Janssen,

Why don't you use in the first place SQL Server 2005 Express Edition or else

MSDE 2000 for Developers Using Visual Studio .NET

you can download these here;

SQL Server 2005 Express Edition
=====================
http://www.microsoft.com/downloads/details.aspx?FamilyID=a0dac778-60a6-4b11-8aa8-bf12261a303a&DisplayLang=en


MSDE 2000 for Developers Using Visual Studio .NET
-----------------------------------------------------------

http://www.microsoft.com/sql/editions/express/howtobuy.mspx

MSDE 2000
========
Microsoft SQL Server 2000 Desktop Engine (MSDE 2000) Release A
-----------------------------------------------------------------------------

http://www.microsoft.com/downloads/details.aspx?FamilyID=413744d1-a0bc-479f-bafa-e4b278eb9147&DisplayLang=en

Bye
Venkat_KL

Re: MS Access problems by Paul

Paul
Mon Nov 28 07:24:37 CST 2005

On Thu, 24 Nov 2005 15:31:07 +0100, "Jan Janssen" <JanJanssen@ned.com> wrote:

¤ Hi there,
¤
¤ I'm currently rewriting an old VB 6 (stand alone) application in VB .Net
¤ 2003 in which users can create MS Access databases. In the new version I
¤ want to add security options like encrypting the database, adding users and
¤ groups etc.
¤
¤ I managed to create MS access databases and tables using ADOX, but I can't
¤ add users and groups to it. I use the following code:
¤
¤ Dim myCat as New ADOX.Catalog
¤ Dim myCon as OleDb.OleDbConnection

Your Connection object is not properly defined:

Dim myCon as ADODB.Connection


Paul
~~~~
Microsoft MVP (Visual Basic)

Re: MS Access problems by Mary

Mary
Mon Nov 28 13:24:36 CST 2005

If you're attempting to work with Access/Jet security, your best bet
is to use DAO through the office PIA. That being said, you do
understand that "Access security" is considered to be an oxymoron, no?
It's been compromised for years (a simple internet search will yield
thousands of results, including source code and services for cracking
it). Most developers consider it to be a waste of time because it does
nothing to protect sensitive data, which should *never* be stored in
Access. BTW, encryption in Access is only good for preventing the
database from being read by a text editor. Anyone who has a copy of
Access can open it.

--Mary

On Thu, 24 Nov 2005 15:31:07 +0100, "Jan Janssen" <JanJanssen@ned.com>
wrote:

>Hi there,
>
>I'm currently rewriting an old VB 6 (stand alone) application in VB .Net
>2003 in which users can create MS Access databases. In the new version I
>want to add security options like encrypting the database, adding users and
>groups etc.
>
>I managed to create MS access databases and tables using ADOX, but I can't
>add users and groups to it. I use the following code:
>
>Dim myCat as New ADOX.Catalog
>Dim myCon as OleDb.OleDbConnection
>Dim myConStr as String
>Dim myNewUser as ADOX.User
>Dim myNewGroup as ADOX.Group
>
>Try
> myConStr = "Provider=Microsoft.Jet.OLEDB.4.0; Jet oledb:system
>database=system.mdw;" & _
> "Data Source=C:\Test.mdb"
> 'Creating the database
> myCat.Create(myConStr)
> myCon = New OleDb.OleDbConnection(myConStr)
> myCon.Open()
>
> myCat.ActiveConnection = myCon <<-- This seems to be the problem
>after debugging the code
>
> 'Creating a new group
> myCat.Groups.Append("User group")
> 'Creating a new user
> myNewUser = New ADOX.User
> myNewUser.Name = "Jan Janssen"
> myCat.Users.Append(myNewUser)
> 'Add new user to the new group
> myNewUser.Groups.Append("User Group")
>
> myCon.Close()
> myCat = Nothing
> myCon = Nothing
>Catch ex as Exception
> MessageBox.Show(ex.Message)
>End Try
>
>When executing this code the following error occurs: "Interface not
>supported"
>
>Can anyone help me out or is there an alternative approach without using SQL
>servers?
>
>thnx
>

Re: MS Access problems by Jan

Jan
Thu Dec 01 13:29:54 CST 2005

Hello Venkat_KL

Thanks for the quick response.

I want to share my application with other users who should be able to create
their own databases at demand. Since I'm not familiar with SQL servers, I'm
not sure it will work.


"Venkat_KL" <VenkatKL@discussions.microsoft.com> schreef in bericht
news:49EE624B-B0CD-4200-8D0D-1E9F05C50E19@microsoft.com...
> Hi Dear Jan Janssen,
>
> Why don't you use in the first place SQL Server 2005 Express Edition or
> else
>
> MSDE 2000 for Developers Using Visual Studio .NET
>
> you can download these here;
>
> SQL Server 2005 Express Edition
> =====================
> http://www.microsoft.com/downloads/details.aspx?FamilyID=a0dac778-60a6-4b11-8aa8-bf12261a303a&DisplayLang=en
>
>
> MSDE 2000 for Developers Using Visual Studio .NET
> -----------------------------------------------------------
>
> http://www.microsoft.com/sql/editions/express/howtobuy.mspx
>
> MSDE 2000
> ========
> Microsoft SQL Server 2000 Desktop Engine (MSDE 2000) Release A
> -----------------------------------------------------------------------------
>
> http://www.microsoft.com/downloads/details.aspx?FamilyID=413744d1-a0bc-479f-bafa-e4b278eb9147&DisplayLang=en
>
> Bye
> Venkat_KL



Re: MS Access problems by Jan

Jan
Thu Dec 01 13:56:53 CST 2005

Thank you for the quick response, Mary.

Let me explain my intention.

I want to create a program in which users can store images along with other
information. The admin can create his databases on demand and specify his
own security measures. One of them is classifying an image. These
classifications can be used to autorisize other users (who have access to
the database) to view certain images (or not).

Since I don't want other users to mess around with these classifications, I
want to encrypt the database so they can't access it via other software.
They are forced to use my program which handles the rest of the security
measures.

PS: The admin can specify the location of theses images or even store them
inside the database (with or without removing the external images).

Jan Janssen


"Mary Chipman [MSFT]" <mchip@online.microsoft.com> schreef in bericht
news:qvlmo1tdg8e1c9ls9to4lac6jd51fojue4@4ax.com...
> If you're attempting to work with Access/Jet security, your best bet
> is to use DAO through the office PIA. That being said, you do
> understand that "Access security" is considered to be an oxymoron, no?
> It's been compromised for years (a simple internet search will yield
> thousands of results, including source code and services for cracking
> it). Most developers consider it to be a waste of time because it does
> nothing to protect sensitive data, which should *never* be stored in
> Access. BTW, encryption in Access is only good for preventing the
> database from being read by a text editor. Anyone who has a copy of
> Access can open it.
>
> --Mary
>
> On Thu, 24 Nov 2005 15:31:07 +0100, "Jan Janssen" <JanJanssen@ned.com>
> wrote:
>
>>Hi there,
>>
>>I'm currently rewriting an old VB 6 (stand alone) application in VB .Net
>>2003 in which users can create MS Access databases. In the new version I
>>want to add security options like encrypting the database, adding users
>>and
>>groups etc.
>>
>>I managed to create MS access databases and tables using ADOX, but I can't
>>add users and groups to it. I use the following code:
>>
>>Dim myCat as New ADOX.Catalog
>>Dim myCon as OleDb.OleDbConnection
>>Dim myConStr as String
>>Dim myNewUser as ADOX.User
>>Dim myNewGroup as ADOX.Group
>>
>>Try
>> myConStr = "Provider=Microsoft.Jet.OLEDB.4.0; Jet oledb:system
>>database=system.mdw;" & _
>> "Data Source=C:\Test.mdb"
>> 'Creating the database
>> myCat.Create(myConStr)
>> myCon = New OleDb.OleDbConnection(myConStr)
>> myCon.Open()
>>
>> myCat.ActiveConnection = myCon <<-- This seems to be the
>> problem
>>after debugging the code
>>
>> 'Creating a new group
>> myCat.Groups.Append("User group")
>> 'Creating a new user
>> myNewUser = New ADOX.User
>> myNewUser.Name = "Jan Janssen"
>> myCat.Users.Append(myNewUser)
>> 'Add new user to the new group
>> myNewUser.Groups.Append("User Group")
>>
>> myCon.Close()
>> myCat = Nothing
>> myCon = Nothing
>>Catch ex as Exception
>> MessageBox.Show(ex.Message)
>>End Try
>>
>>When executing this code the following error occurs: "Interface not
>>supported"
>>
>>Can anyone help me out or is there an alternative approach without using
>>SQL
>>servers?
>>
>>thnx
>>



Re: MS Access problems by Jan

Jan
Thu Dec 01 14:35:54 CST 2005

Hello Paul,

Thank you for your quick response. Although the bug has been fixed by using
an ADODB connection, the code still doesn't work.

myCat.Groups.Append("Test") returns the following error message:
"System.Runtime.InteropServices.COMException (0x800A0CB3): De gewenste
bewerking kan niet worden uitgevoerd."

Translated: Can't perform this action.

Oh well, back to the drawing board.

thanks anyway


"Paul Clement" <UseAdddressAtEndofMessage@swspectrum.com> schreef in bericht
news:h61mo1t83nbs05sckhls0fqk952cl860sc@4ax.com...
> On Thu, 24 Nov 2005 15:31:07 +0100, "Jan Janssen" <JanJanssen@ned.com>
> wrote:
>
> ¤ Hi there,
> ¤
> ¤ I'm currently rewriting an old VB 6 (stand alone) application in VB .Net
> ¤ 2003 in which users can create MS Access databases. In the new version I
> ¤ want to add security options like encrypting the database, adding users
> and
> ¤ groups etc.
> ¤
> ¤ I managed to create MS access databases and tables using ADOX, but I
> can't
> ¤ add users and groups to it. I use the following code:
> ¤
> ¤ Dim myCat as New ADOX.Catalog
> ¤ Dim myCon as OleDb.OleDbConnection
>
> Your Connection object is not properly defined:
>
> Dim myCon as ADODB.Connection
>
>
> Paul
> ~~~~
> Microsoft MVP (Visual Basic)



Re: MS Access problems by Paul

Paul
Tue Dec 06 07:56:14 CST 2005

On Thu, 1 Dec 2005 21:35:54 +0100, "Jan Janssen" <JanJanssen@ned.com> wrote:

¤ Hello Paul,
¤
¤ Thank you for your quick response. Although the bug has been fixed by using
¤ an ADODB connection, the code still doesn't work.
¤
¤ myCat.Groups.Append("Test") returns the following error message:
¤ "System.Runtime.InteropServices.COMException (0x800A0CB3): De gewenste
¤ bewerking kan niet worden uitgevoerd."
¤
¤ Translated: Can't perform this action.
¤

I would recommend using Jet SQL if possible. This will eliminate the need for ADOX or DAO COM
interop.

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnacc2k/html/acadvsql.asp


Paul
~~~~
Microsoft MVP (Visual Basic)

Re: MS Access problems by Jan

Jan
Wed Dec 07 12:35:26 CST 2005

I will give a shot..

Thnx Paul.


"Paul Clement" <UseAdddressAtEndofMessage@swspectrum.com> schreef in bericht
news:116bp11qsqb765s3gkv1fgb8s9duej39k4@4ax.com...
> On Thu, 1 Dec 2005 21:35:54 +0100, "Jan Janssen" <JanJanssen@ned.com>
> wrote:
>
> ¤ Hello Paul,
> ¤
> ¤ Thank you for your quick response. Although the bug has been fixed by
> using
> ¤ an ADODB connection, the code still doesn't work.
> ¤
> ¤ myCat.Groups.Append("Test") returns the following error message:
> ¤ "System.Runtime.InteropServices.COMException (0x800A0CB3): De gewenste
> ¤ bewerking kan niet worden uitgevoerd."
> ¤
> ¤ Translated: Can't perform this action.
> ¤
>
> I would recommend using Jet SQL if possible. This will eliminate the need
> for ADOX or DAO COM
> interop.
>
> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnacc2k/html/acadvsql.asp
>
>
> Paul
> ~~~~
> Microsoft MVP (Visual Basic)