[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 543
  • Last Modified:

VB.NET App Connect to Oracle 9i Login Screen Parameters

Hi All,
I'm hoping that this is a dumb question but it's just one I can't find the answer to.  I've developed an application with Visualt Studio 2003 in VB that connects to an oracle 9i DB but the User/PW is imbedded in the application properties.  This of course breaks that rules at my company and I must remove the hard coded User/PW from the programs connection string.  

Can someone point me in the correct direction of how to setup a LogIn page for the application i.e. how do I assign the User/PW dynamically when the app starts.  I can certainly create the page I just dont know how to assing the proper variables on a login page.

Thanks
-Rob
0
rwkuhnle
Asked:
rwkuhnle
  • 2
1 Solution
 
Solar_FlareCommented:
you need to take the strings that the user enters on the login form and insert them into the connection string. You could do something simple like change the connectionstring by replacing the username and password with #USER and #PASS then in the login form replace those with the entered values

eg
dim connectionstring = <get connectionstring>

dim actualconnectionstring = connectionstring.Replace("#USER", username.Text).Replace("#PASS", password.Text)

then use actualconnectionstring for your connection
0
 
rwkuhnleAuthor Commented:
Exactly what I do need to do but I don't know where in a VB.NET app to actually assign those value.  I presume there is some underlying form or module that the system is managing that I have yet to physically work with that needs to be passed those parameters in order to populate the connection string with the UID/PW values.  That's the part that I really need :-)
Thanks
-Rob
0
 
Solar_FlareCommented:
you could have a shared string somewhere that you use for the connection string

eg
public class Form1
   public shared MyConnStr as String

then when the user clicks ok for the login details you could do
dim connectionstring = <get connectionstring>
MyConnStr = connectionstring.Replace("#USER", username.Text).Replace("#PASS", password.Text)

then whereever you use the connection string use Form1.MyConnStr instead
0

Featured Post

Get your Disaster Recovery as a Service basics

Disaster Recovery as a Service is one go-to solution that revolutionizes DR planning. Implementing DRaaS could be an efficient process, easily accessible to non-DR experts. Learn about monitoring, testing, executing failovers and failbacks to ensure a "healthy" DR environment.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now