Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Setting ODBC/BDE User Name

Status
Not open for further replies.

Bystander

Technical User
Sep 4, 2001
112
GB
Dear All,

I have an application that connects to a couple of Oracle databases using the "setAliasPassword(aliasName, aliasPassword)" syntax. Recently I have found that it would be very desireable to be able to set the User Name. Can anyone advise what code I could use to set the User Name please. I cant find anything that does it anywhere.

Many thanks

Bystander
 
Lance,

Thank you for that but because my users can move between machines I am reluctant to put the user name in Alias Manager. Essentially I want to use an ObjectPAL Database variable to set the user name and password automatically.

Regards

Bystander

 
Bystander,

The article on my site shows the code you need to do this. You would simply add username to the dynarray before opening the database.

Something like this should work:

Code:
   method run(var eventInfo Event)
   var
     db  Database
     dat DynArray[] AnyType
     frm Form
   endVar

   dat[ "USERNAME" ] = "SYSDBA"
   dat[ "PASSWORD" ] = "masterkey"

   if not db.open( "iblocal", dat ) then
     errorShow( "Can't Open Database",
                "Click >> button for details." )
   else
      frm.open( "ibcustomer" )
   endIf

   endMethod

Hope this helps...

-- Lance
 
Lance,

You are an officer and a gentleman. That looks spot on, I can play with passing in user entered values.

Many thanks

Bystander
 
Dear Lance,

Sorry for being tardy.

A bit of feedback - I had to play around a bit and changed dat[ "USERNAME" ] to dat[ "USER NAME" ]. After that the solution worked excellently. As always very many thanks.

Bystander

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top