Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
BOOK: Beginning Visual Basic 2005 Databases ISBN: 978-0-7645-8894-5
This is the forum to discuss the Wrox book Beginning Visual Basic 2005 Databases by Thearon Willis; ISBN: 9780764588945
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning Visual Basic 2005 Databases ISBN: 978-0-7645-8894-5 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
  #1 (permalink)  
Old May 3rd, 2008, 01:09 PM
Registered User
 
Join Date: May 2008
Location: NYC, NY, USA.
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Registry Key Object

 Hi Thearon,
The beginning Visual Basic book 2005, is a great book where we can work with Oracle and SQL servers,and using BLL/DAL which it is the ideal method for serious developer in developing 3 Tier application, and avoiding creating Dataset through the wizard.

However, I have a problem to apply your code in my projects, where we the developers do not have Admin rights to use the registry.
Please, can you help to get the Login Screen working without using the object of the "RegistryKey" in the WDBASE.VB module?

I appreciate any help in running your application in Oracle 9.2 without the RegistryKey.
Best Regards,
Stephen
  #2 (permalink)  
Old May 5th, 2008, 04:56 AM
Thearon's Avatar
Wrox Author
 
Join Date: Dec 2003
Location: Fuquay Varina, NC, USA.
Posts: 396
Thanks: 0
Thanked 8 Times in 8 Posts
Default

Stephen,

You can use the application's configuration file. Open your project in Visual Studio and then double click on "My Project" in the Solution Explorer. When the application properties window appears, click on the Settings tab on the left side. You can place the information that you would have stored in the registry here.

Remember to also copy these settings to any other application that would normally need to read those settings from the registry.

Thearon
  #3 (permalink)  
Old May 6th, 2008, 08:30 AM
Registered User
 
Join Date: Jan 2005
Location: , , .
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks Thearon:
The Scope should be "User" or "Application"?
For now my setting is scope:User, Type:Connection:
Value: Data Source=OracleDB;Persist Security Info=True;User ID=USERNAME;Password=PASSWORD;Unicode=True

So where I should add the line: objReg = Registry.LocalMachine.OpenSubKey("SOFTWARE\" & _
                    Company & "\" & Application & "\Database", False)

Do I keep it in the WDABASE?
Thanks
  #4 (permalink)  
Old May 6th, 2008, 08:58 AM
Thearon's Avatar
Wrox Author
 
Join Date: Dec 2003
Location: Fuquay Varina, NC, USA.
Posts: 396
Thanks: 0
Thanked 8 Times in 8 Posts
Default

Stephen,

If you want the application to be able to update the settings then the scope should be "User" as this allows read and write capability. A scope of "Application" is read only.

Assumming you are using SQL Server and the connection string was set in the WroxDataAccess project and called "Connection", you could use the following line of code to build your SQLConnection object:

Connection = New SqlConnection(My.Settings.Connection)

This will retrieve the connection string from the component's configuration file and instantiate a new SqlConnection object.

Thearon
  #5 (permalink)  
Old May 6th, 2008, 01:26 PM
Registered User
 
Join Date: Jan 2005
Location: , , .
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thank you Tearon very much, your answer is very helpful.
I am using ORACLE 9.2+ VS2005 Win Forms, My connection string is defined as:

Public cn As OracleConnection = New OracleConnection(ConfigurationManager.ConnectionSt rings("OraDB").ConnectionString)

Thanks and best regards,
Stephen


Similar Threads
Thread Thread Starter Forum Replies Last Post
Get Path from the registry key in VB.NET remya1000 General .NET 1 September 2nd, 2008 04:01 PM
Fetch Licence key from Remote Registry saumya Visual Studio 2005 0 December 3rd, 2007 11:32 PM
COM Interop Access to the registry key denied dshamim ASP.NET 2.0 Professional 1 March 21st, 2007 02:00 AM
create a registry key sentme_mail General .NET 0 January 28th, 2006 09:28 AM
Unable to open registry key 'Temporary p2ptolu Classic ASP Databases 3 March 7th, 2005 06:49 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.