 |
| VB Databases Basics Beginning-level VB coding questions specific to using VB with databases. Issues not specific to database use will be redirected to other forums. |
Welcome to the p2p.wrox.com Forums.
You are currently viewing the VB Databases Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
|
|
|
|

May 6th, 2004, 09:14 AM
|
|
Registered User
|
|
Join Date: May 2004
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
PLEASE HELP, VB6 and DAO
to put it short...i wrote an application for everyone in our company to access a table in a database via DAO. We keep the access97 databases hidden and locked out with active directory rights given to only 4 people, but this program is going to be accessing the data, i was wondering if there was a way to pass active directory credentials when the connection is made.
For example, i run the program logged in to the domain as myself, and i can connect to the database...but if i run the program on a standard users computer, the program crashes.
Please help!!!
Self Taught
|
|

May 6th, 2004, 09:25 AM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 1,212
Thanks: 0
Thanked 1 Time in 1 Post
|
|
If you do your database access through a component, such as ActiveX DLL, you can set it up (either through DCOM Config or by putting the component in a COM+ package) so that the data access component always runs as a specific user regardless of which user is actually running the application. That way you don't have to give all users access rights to the database itself, you just have to give them access and launch rights to your data access component.
Let me know if you're interested in this method and I can give you more details of the actual setup. Also let me know what OS you're using on the clients and servers.
hth
Phil
|
|

May 6th, 2004, 09:35 AM
|
|
Registered User
|
|
Join Date: May 2004
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
our Domain controller is running 2000 server and the clients are xp pro.
using dao is the most familiar way for me to do my data connection...and my program is basically complete, so it would really be hard for me to change this data connection method.
ive just used DAO's recordset feature, is there a way to connect to a recordset with Active directory user credentials?
Self Taught
|
|

May 6th, 2004, 09:45 AM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 1,212
Thanks: 0
Thanked 1 Time in 1 Post
|
|
Sorry, didn't mean to confuse you. You can still use DAO. What I meant was instead of having code directly in your app .exe talking to the database, you move all database interaction to a separate DLL (which can still use DAO to talk to the db) and whenever your app needs to get data from the db, or put data in there it goes through your DLL instead of going directly through DAO.
Personally, I don't know of any way to impersonate a different user from within your code, but that doesn't mean it can't be done...
rgds
Phil
|
|

May 6th, 2004, 09:48 AM
|
|
Registered User
|
|
Join Date: May 2004
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
oh ok, yeah i was really confused...i wouldnt have the first clue how to do that man...how difficult would it be?
Self Taught
|
|

May 6th, 2004, 09:59 AM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 1,212
Thanks: 0
Thanked 1 Time in 1 Post
|
|
How difficult would that be to do? Depends how your app is structured at the moment. For example, if you have db code scattered through your app and you use things like bound fields it probably won't be worth the effort. On the other hand if you have separate functions in your app that do the db calls it would be much simpler to move those out into a separate dll.
A DLL is no more difficult to create than an exe, as far as VB is concerned its just a different type of project. And calling a dll from your app is straightforward too.
Can you give a quick outline of what sort of stuff your app does?
|
|

May 6th, 2004, 10:14 AM
|
|
Registered User
|
|
Join Date: May 2004
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
if you email me i can zip the project to you and you can see it...just as long as you dont taunt the ameteur style
Self Taught
|
|
 |