Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

auto connect to the forms and reports

Posted on 2014-02-10
14
Medium Priority
?
1,083 Views
Last Modified: 2014-02-14
hi
i'm designing my forms
is there any way to save the connect script to the form instead of manual connect every time
as so to the report also
0
Comment
Question by:NiceMan331
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
  • 4
  • 4
14 Comments
 
LVL 19

Assisted Solution

by:Thommy
Thommy earned 500 total points
ID: 39849306
0
 

Author Comment

by:NiceMan331
ID: 39849338
the last post there is :

This can be done in the when_new_form_instance trigger

u can use the connect username/passwd@database

what is the exact code will be ?
0
 
LVL 19

Expert Comment

by:Thommy
ID: 39849449
Navigate to Triggers >> WHEN-NEW-FORM-INSTANCE in the Object Navigator

Enter your connect string and save form...

Enter your Connect string in PL/SQL-Editor of When-New-Forms-Instance trigger...
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:NiceMan331
ID: 39849774
i'm asking what is the correct code for connect , not how to work with a trigger ?

connect db eds83125/aidol@orcl;

Open in new window


it sent error

encountered the symbol "connect" when expecting one fo the followings
0
 
LVL 19

Expert Comment

by:Thommy
ID: 39849998
I have never tried logon in trigger WHEN-NEW-FORM-INSTANCE!!!

What I already did was doing the login by a shortcut, which is also described in my posted link.

You may also try ON-LOGON trigger as described in the last reply of the link...
0
 
LVL 35

Accepted Solution

by:
Mark Geerlings earned 500 total points
ID: 39850812
Oracle Forms assumes that you will want users to log in manually.  But, if you want to do a hard-coded logon automatically, this syntax should work in an "ON-LOGON" trigger:

LOGON('user_name', 'password@' || 'db_alias', FALSE);

Most Oracle Forms-based applications that I have seen include a "menu" form that usually prompts the user to do a login, then presents a list of other forms the user can get to via CALL_FORM or OPEN_FORM commands from the "menu" form.  That way, no new connection or login is required for the other forms that the user can get to.  Also, the login credentials are passed to the reports automatically, so no separate login is required for the reports either (even though the reports use a separate database session).
0
 
LVL 19

Expert Comment

by:Thommy
ID: 39851190
Markgeer rightly explained the principles of Forms and Reports with mainly manual login.

But nevertheless, if you want automatic login, then use on-logon trigger, as I already suggested in my previous post...
0
 

Author Comment

by:NiceMan331
ID: 39851443
LOGON('user_name', 'password@' || 'db_alias', FALSE);

Open in new window


i used it , but when i closed the form , then re open it , it asked me to log in to the database
0
 
LVL 35

Expert Comment

by:Mark Geerlings
ID: 39851510
That is the expected behavior for Oracle Forms.  Did you read what I posted earlier:
"Most Oracle Forms-based applications that I have seen include a "menu" form that usually prompts the user to do a login, then presents a list of other forms the user can get to via CALL_FORM or OPEN_FORM commands from the "menu" form.  That way, no new connection or login is required for the other forms that the user can get to."

Usually that "menu" form is kept open to keep the database connection open.  If you create a form like this that can stay open, and you put the LOGON command in that form, you should then be able to open other forms from that not be prompted for a login.
0
 

Author Comment

by:NiceMan331
ID: 39851548
Most Oracle Forms-based applications that I have seen include a "menu" form that usually prompts the user to do a login

i see you are speaking about forms ready to use by users and includes menu forms
i'm speaking about a form that still under design , not yet finish
i'm daily opening form builder then open the form to add some changes , till final it
0
 
LVL 35

Expert Comment

by:Mark Geerlings
ID: 39851555
You are correct.  Our solution to that was to add the new form to our "menu" form (in a test system) the first day that we created the new form, so we could easily test it from our menu during the development process, even before it was ready for user testing.
0
 

Author Comment

by:NiceMan331
ID: 39851570
I still not understand how to use my under design form from a menu form
0
 
LVL 35

Expert Comment

by:Mark Geerlings
ID: 39851670
No, don't try to run it from Forms Designer.  I was talking about running it from a menu form.  Forms Designer will prompt you for a new login every time (although if you include an ON-LOGON trigger in your form that includes the LOGON command like I gave you, that should work automatically.  Just remember to remove that ON-LOGON trigger before you give this form to the users, unless you also want them to be able to also use a hard-coded automated login.  (That sounds like a security problem to me.)
0
 

Author Comment

by:NiceMan331
ID: 39852398
ok
so in coclusion , no way to save log on if i open the form via form designer ?
0

Featured Post

Prepare for your VMware VCP6-DCV exam.

Josh Coen and Jason Langer have prepared the latest edition of VCP study guide. Both authors have been working in the IT field for more than a decade, and both hold VMware certifications. This 163-page guide covers all 10 of the exam blueprint sections.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I remember the day when someone asked me to create a user for an application developement. The user should be able to create views and materialized views and, so, I used the following syntax: (CODE) This way, I guessed, I would ensure that useā€¦
Shell script to create broker configuration file using current broker Configuration, solely for purpose of backup on Linux. Script may need to be modified depending on OS-installation. Please deploy and verify the script in a test environment.
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
Via a live example, show how to take different types of Oracle backups using RMAN.

721 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question