Go Back  Xtreme Visual Basic Talk > Legacy Visual Basic (VB 4/5/6) > Database and Reporting > Using a Microsoft Access workgroup file with ADO datacontrol object.


Reply
 
Thread Tools Display Modes
  #1  
Old 05-18-2005, 06:14 AM
rickys rickys is offline
Freshman
 
Join Date: Apr 2005
Posts: 48
Question Using a Microsoft Access workgroup file with ADO datacontrol object.


Hello everyone,

I have a little situation that I need help with urgently. I have a VB6 application that uses a microsoft access database to store all the information. The database has about 5 tables that keep track of various customer transactions etc. Just so that noone can open this access database, I have setup a database password. Noone ever needs to find out or change this password, therefore I have it hard-coded into the application itself. I also have a user called EMPLOYEE and a password for that username. This is the one and the only user thats ever going to access the database therfore, its all hard-coded inside the application. My application uses both ADODB.Recordset objects and ADO datacontrol objects. Everything works fine with the recrodset as I can show the workgroup file in the code like this:

oConn.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=c:\somepath\mydb.mdb;" & _
"Jet OLEDB:System Database=MySystem.mdw", _
"myUsername", "myPassword"



However, for the ado datacontrol object (the one that looks like a horizontal scrollbar), I don't know how to indicate what the workgroup file is (MySystem.mdw). Is there a property that I can set for this control to fix this issue? Every time I run the program and go to a datagrid that takes its values from this ADO datacontrol, it crashes with an error saying: Workgroup file is missing or opened by another user.

Not sure if this made much sense but I tried my best.

Please help...


Thanks
Reply With Quote
  #2  
Old 05-18-2005, 07:41 AM
IUnknown's Avatar
IUnknown IUnknown is offline
Senior Contributor

Forum Leader
* Expert *
 
Join Date: Oct 2004
Location: Montréal
Posts: 1,135
Default

You can supply the same connection string to the ADO datacontrol, or you can try this to generate the required ConnectionString.

1. Open up the Property Pages for the ADO datacontrol.
2. On the General Tab, click on the option Use Connection String.
3. Click on the Build button.
4. The DataLink Properties window will appear.
5. In the Provider Tab, select Microsoft Jet X.XX OLE DB Provider (where X.XX is the version)
6. In the Connection Tab, enter your Access DB name and Logon information
7. Go to the All Tab.
8. Scroll down the list until you see "Jet OLEDB System Database" in the Name column.
9. Change this value to your System.mdw full path.
10. Click OK.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
 
 
-->