Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Stopping ODBC connection window from coming up...

Re: Stopping ODBC connection window from coming up...

From: Arthur J. Butler <arthurb_at_emag-pc.com>
Date: Sun, 10 Oct 1999 15:35:16 -0400
Message-ID: <3800EA74.9764CC64@emag-pc.com>


Thanks for the feedback. I am supplying the full DSN. However, if the password is incorrect, the Oracle password window comes up as you say. This Oracle password window is the one I do not want to come up. I would just want the call to OpenDatabase to fail. I am using VB 4.x and the following code to open the database where host_string, user, and passwd are string variables..

    connection = "ODBC;DRIVER={Oracle ODBC Driver};DBQ=" & host_string & ";UID=" & user & ";PWD=" & passwd"

    Set db = DBEngine.Workspaces(0).OpenDatabase("", False, False, connection)

Anyone have an idea how I can prevent the Oracale password window from coming up?

Thanks,

Arthur

cpereyra_at_ix.netcom.com wrote:

> Using DAO, the code is something pretty close to this:
>
> dim db as database
> dim strConn as string
> strConn = "ODBC;DSN=<somedsn>;UID=<someuid>;PWD=<somepwd>"
>
> set db = OpenDatabase("", dbDriverNoPrompt, False, strConn)
>
> The combination of a full DSN string providing the user id, dsn and
> password in combination with the dbDriverNoPrompt parameter stops the
> Oracle logging window from showing up. Note that should the password
> or username provided be incorrect, the Oracle password window will come
> up. Make sure you have code to handle that possibility.
>
> Carlos.
> In article <7tij9b$v2f$1_at_nnrp1.deja.com>,
> steve_billingsley_at_my-deja.com wrote:
> > I am using Oracle 7 so the error number I list
> > below might be different.
> >
> > Anyways, this is one way to do it..
> >
> > On error resume next
> >
> > Userid = Request("IDNO")
> > Passid = Request("PassWd")
> >
> > Set Connect =
> > Server.CreateObject("ADODB.Connection")
> >
> > Connect.Open "DatabaseName", Userid, Passid
> > if Connect.Errors.Item(0).NativeError = 1017 then
> > ' check the oracle error number for invalid
> > username/password
> > ErrorText = "<font color=red>Please enter a
> > valid username and password</font><p>"
> > else ...
> >
> > Sent via Deja.com http://www.deja.com/
> > Before you buy.
> >
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
Received on Sun Oct 10 1999 - 14:35:16 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US