473,770 Members | 1,989 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Listing users of a database

I have used code from MS 198755 to create a module that lists current
users of the database. Works fine as long as db isnot password
potected. How do I adapt code to enter password?

This is code:

Sub ShowUserRosterM ultipleUsers()
Dim cn As New ADODB.Connectio n
Dim cn2 As New ADODB.Connectio n
Dim rs As New ADODB.Recordset
Dim i, j As Long

cn.Provider = "Microsoft.Jet. OLEDB.4.0"
cn.Open "Data Source=c:\North wind.mdb"

cn2.Open "Provider=Micro soft.Jet.OLEDB. 4.0;" _
& "Data Source=c:\North wind.mdb"

' The user roster is exposed as a provider-specific schema rowset
' in the Jet 4 OLE DB provider. You have to use a GUID to
' reference the schema, as provider-specific schemas are not
' listed in ADO's type library for schema rowsets

Set rs = cn.OpenSchema(a dSchemaProvider Specific, _
, "{947bb102-5d43-11d1-bdbf-00c04fb92675}")

'Output the list of all users in the current database.

Debug.Print rs.Fields(0).Na me, "", rs.Fields(1).Na me, _
"", rs.Fields(2).Na me, rs.Fields(3).Na me

While Not rs.EOF
Debug.Print rs.Fields(0), rs.Fields(1), _
rs.Fields(2), rs.Fields(3)
rs.MoveNext
Wend

End Sub

Many thanks for any help

Nov 13 '05 #1
4 2682
On 3 Nov 2005 13:10:18 -0800, "bill..AT..pipe rb.freeserve.co .uk"
<bi**@piperb.fr eeserve.co.uk> wrote:

You put the password as part of the connect string in the Open method.
See connectionstrin gs.com for examples for that.

-Tom.

I have used code from MS 198755 to create a module that lists current
users of the database. Works fine as long as db isnot password
potected. How do I adapt code to enter password?

This is code:

Sub ShowUserRosterM ultipleUsers()
Dim cn As New ADODB.Connectio n
Dim cn2 As New ADODB.Connectio n
Dim rs As New ADODB.Recordset
Dim i, j As Long

cn.Provider = "Microsoft.Jet. OLEDB.4.0"
cn.Open "Data Source=c:\North wind.mdb"

cn2.Open "Provider=Micro soft.Jet.OLEDB. 4.0;" _
& "Data Source=c:\North wind.mdb"

' The user roster is exposed as a provider-specific schema rowset
' in the Jet 4 OLE DB provider. You have to use a GUID to
' reference the schema, as provider-specific schemas are not
' listed in ADO's type library for schema rowsets

Set rs = cn.OpenSchema(a dSchemaProvider Specific, _
, "{947bb102-5d43-11d1-bdbf-00c04fb92675}")

'Output the list of all users in the current database.

Debug.Print rs.Fields(0).Na me, "", rs.Fields(1).Na me, _
"", rs.Fields(2).Na me, rs.Fields(3).Na me

While Not rs.EOF
Debug.Print rs.Fields(0), rs.Fields(1), _
rs.Fields(2), rs.Fields(3)
rs.MoveNext
Wend

End Sub

Many thanks for any help


Nov 13 '05 #2
Thanks Tom but sorry to be thick, I do not seem to be able to get it to
work.

Should I put
cn.Open "Data Source=c:\North wind.mdb,,passw ord"
or
cn.Open "Data Source=c:\North wind.mdb"; ; "password"
or
cn.Open "Data Source=c:\North wind.mdb"; ; pwd = "password"
or........
And do I need to put the same bit into the other data source line?

As you can tell I am far from expert!
Cheers for any help.
Bill
Tom van Stiphout wrote:
On 3 Nov 2005 13:10:18 -0800, "bill..AT..pipe rb.freeserve.co .uk"
<bi**@piperb.fr eeserve.co.uk> wrote:

You put the password as part of the connect string in the Open method.
See connectionstrin gs.com for examples for that.

-Tom.

I have used code from MS 198755 to create a module that lists current
users of the database. Works fine as long as db isnot password
potected. How do I adapt code to enter password?

This is code:

Sub ShowUserRosterM ultipleUsers()
Dim cn As New ADODB.Connectio n
Dim cn2 As New ADODB.Connectio n
Dim rs As New ADODB.Recordset
Dim i, j As Long

cn.Provider = "Microsoft.Jet. OLEDB.4.0"
cn.Open "Data Source=c:\North wind.mdb"

cn2.Open "Provider=Micro soft.Jet.OLEDB. 4.0;" _
& "Data Source=c:\North wind.mdb"

' The user roster is exposed as a provider-specific schema rowset
' in the Jet 4 OLE DB provider. You have to use a GUID to
' reference the schema, as provider-specific schemas are not
' listed in ADO's type library for schema rowsets

Set rs = cn.OpenSchema(a dSchemaProvider Specific, _
, "{947bb102-5d43-11d1-bdbf-00c04fb92675}")

'Output the list of all users in the current database.

Debug.Print rs.Fields(0).Na me, "", rs.Fields(1).Na me, _
"", rs.Fields(2).Na me, rs.Fields(3).Na me

While Not rs.EOF
Debug.Print rs.Fields(0), rs.Fields(1), _
rs.Fields(2), rs.Fields(3)
rs.MoveNext
Wend

End Sub

Many thanks for any help


Nov 13 '05 #3
On 4 Nov 2005 13:06:14 -0800, "bill..AT..pipe rb.freeserve.co .uk"
<bi**@piperb.fr eeserve.co.uk> wrote:

cn.Open "Provider=Micro soft.Jet.OLEDB. 4.0;Data
Source=c:\North wind.mdb;Jet OLEDB:Database
Password=SomeSe cretPassword;"

In your code sample you are not using cn2. Comment out all lines with
cn2 and you'd still be OK.

-Tom.

Thanks Tom but sorry to be thick, I do not seem to be able to get it to
work.

Should I put
cn.Open "Data Source=c:\North wind.mdb,,passw ord"
or
cn.Open "Data Source=c:\North wind.mdb"; ; "password"
or
cn.Open "Data Source=c:\North wind.mdb"; ; pwd = "password"
or........
And do I need to put the same bit into the other data source line?

As you can tell I am far from expert!
Cheers for any help.
Bill
Tom van Stiphout wrote:
On 3 Nov 2005 13:10:18 -0800, "bill..AT..pipe rb.freeserve.co .uk"
<bi**@piperb.fr eeserve.co.uk> wrote:

You put the password as part of the connect string in the Open method.
See connectionstrin gs.com for examples for that.

-Tom.

>I have used code from MS 198755 to create a module that lists current
>users of the database. Works fine as long as db isnot password
>potected. How do I adapt code to enter password?
>
>This is code:
>
>Sub ShowUserRosterM ultipleUsers()
> Dim cn As New ADODB.Connectio n
> Dim cn2 As New ADODB.Connectio n
> Dim rs As New ADODB.Recordset
> Dim i, j As Long
>
> cn.Provider = "Microsoft.Jet. OLEDB.4.0"
> cn.Open "Data Source=c:\North wind.mdb"
>
> cn2.Open "Provider=Micro soft.Jet.OLEDB. 4.0;" _
> & "Data Source=c:\North wind.mdb"
>
> ' The user roster is exposed as a provider-specific schema rowset
> ' in the Jet 4 OLE DB provider. You have to use a GUID to
> ' reference the schema, as provider-specific schemas are not
> ' listed in ADO's type library for schema rowsets
>
> Set rs = cn.OpenSchema(a dSchemaProvider Specific, _
> , "{947bb102-5d43-11d1-bdbf-00c04fb92675}")
>
> 'Output the list of all users in the current database.
>
> Debug.Print rs.Fields(0).Na me, "", rs.Fields(1).Na me, _
> "", rs.Fields(2).Na me, rs.Fields(3).Na me
>
> While Not rs.EOF
> Debug.Print rs.Fields(0), rs.Fields(1), _
> rs.Fields(2), rs.Fields(3)
> rs.MoveNext
> Wend
>
>End Sub
>
>Many thanks for any help


Nov 13 '05 #4
Thanks Tom. I will give it a whirl!

Bill

Nov 13 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
2469
by: Chris | last post by:
Hi, Not sure if this is the right forum, but hopefully someone can help me. I am creating something for our intranet and i want to list the files and folders of a directory, i found some code to do this. The only problem is that it lists the asp file used to for example if i go to: "http://myserver/listing.asp" In the file listing will be "listing.asp" amongst a lot of marketing documents.
3
3101
by: David Callaghan | last post by:
Hi I've just joined tesco broadband. I've come from NTL. If I don't put an index.htm on my NTL home page it justs lists the files in there when any browser visites my page. If I don't put an index.htm on my Tesco home page, I get a:
2
1300
by: Somesh | last post by:
Hi, 1.I have installed and running a plone Intranet site, I have registerd users on it. I want to get list of all registerd users on a page. how I should move towards getting it / scripting it in my index_html page ? I am just a frontend user of plone. 2.How to start creating small database driven pages programming on plone ?
19
3315
by: SU News Server | last post by:
I've struggled with this for quite a while and I'm am just not sure what is going on. I have the following code import os def buildList( directory='/Users/mkonrad' ) dirs = listing = os.listdir(directory)
1
1123
by: Karen Hill | last post by:
I would like to be able to list all the users of a MS Access database in a combo box. How would one do this? What is the function or Sub look like to do something like this? I have ADO 3.6 I believe (Access 2000). Thanks in advance for all your help
2
1374
by: Tim_Mac | last post by:
this could be seen as petty... but i noticed if you browse a folder on a .net 2 virtual directory, you get the directory listing. but the font styles are set to 8 point verdana which is uncomfortably small for some users on some resolutions. the fact that they hard-coded it in the css styles means it ignores the browser font-size setting, so it breaks a very important accessibility guideline. this is just another reason to use firefox...
8
11066
by: gil | last post by:
Is it possible to prevent a browser from listing the entire contents of a folder? The site, is hosted on my ISP with the following layout- site/ "user name from ISP" pagefile (dir) index.html site/pagefile/
3
1261
by: Seok Bee | last post by:
Hi All, Currently I have a storage server to allow users to store their files in a central location. In this server, there are many sub-folders for different departments. What I would like to do is to have a script to generate a listing that will show in each folder who are the users accessible to the folder and what are the permission granted to them.
3
4932
by: =?Utf-8?B?ZG1idXNv?= | last post by:
I would like a listing of all users in the current domain (or on my computer). I'm running Windows XP Home Edition and I've set up four user, one for each member of my family. 'My.User.Name' just lists me. How do I get the others? I looked at some code posted here on 4/27/07 and it doesn't work, I've already tried it. Thanks in advance. --
0
9618
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10259
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10101
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9906
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7456
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6710
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5482
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4007
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3609
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.