Hi !

> -----Original Message-----
> From: Sylvain Hamel [mailto:[EMAIL PROTECTED]]
> Sent: Friday, October 05, 2001 5:34 PM
> To: [EMAIL PROTECTED]; MySQL Mailing list
> Subject: Re: DSN-Less connections using MyODBC?
>
>
> Hi Venu,
>
> > It doesn't depend upon OPTION value. Can you change the following
> > parameters and try it out.
> >
> > 1. UID instead of USER NAME
> > 2. DATABASE or DB instead of DATABASE NAME
> > 3. PWD instaed of PASSWORD
>
> I assume USER NAME and PASSWORD are right since the parser
> recognizes them
> correctly when I use a dsn connection. If the driver wasnt
> loaded properly
> shouldn't it crash also on a DSN connection? Like I said it
> works fine for a
> DSN connection but not for a DSN-LESS connection.

I didn't get you here. Why you want to assume both DSN and DSN-less
connection exhibits the same behavior ?.

Let me brief the difference:

1. DSN Based Connection:
------------------------
When you specify a valid DSN name in your connection string,
using the KEYWORD DSN, then driver manager checks for the DSN
from odbc.ini and loads the appropriate driver and passes the
connection information. If it doesn't find, then it checks for
the default driver and loads that driver. If there is no default
driver specified then it returns error as

 "Data source not found and no default driver specified"

Now MyODBC driver parses the input connect string for the
following set of one or more connection parameters:

-- DSN
-- SERVER
-- DATABASE or DB
-- UID (USER, USERNAME)
-- PWD (PASSWORD)
-- PORT
-- OPTION
-- STMT

First driver collects all parameter values set to the DSN already
from odbc.ini. if user passes any parameters through connection
string,
then driver overrides with this values and tries to connect to the
server

2. DSN-less Connection:
-----------------------
To make a DSN-less connection, you need to specify a valid driver
name in the connection string using the standard keyword DRIVER,
with appropriate connection parameters.

Then driver manager checks for the DRIVER name and loads the
appropriate driver and passes the connection information to
the driver.

If you didn't specified the DRIVER keyword, then it checks for the
default driver else returns error.

Make a note that, in this case, you need to explicitly pass valid
connection information to the driver, else it uses default values,
or at least you need set SQL_DRIVER_PROMPT, so that the driver
prompts for the connection information.

> I also
> assume my program
> is ok since it works with an Access97 database. I also
> assume DATABASE NAME
> is the right keyword since I tried it with said Access97
> connection. The
> only thing left is the SERVER keyword since PORT 3306 is
> the default one and
> therefore that item need not be specified.
>
> One thing I am curious about is where are these keywords
> defined? I mean at
> first I thought these where standards across all
> implementations but I have
> encountered many different syntax like UID instead of USER
> or USER NAME,
> etc.... Is there a way to check this out? To ensure I have
> the right syntax?

Its here...
http://www.mysql.com/documentation/mysql/bychapter/manual_Clients.html
#MyODBC_connect_parameters


Regards, venu
--
For technical support contracts, go to https://order.mysql.com
   __  ___     ___ ____  __
  /  |/  /_ __/ __/ __ \/ /  Mr. Venu <[EMAIL PROTECTED]>
 / /|_/ / // /\ \/ /_/ / /__ MySQL AB, Developer
/_/  /_/\_, /___/\___\_\___/ California, USA
       <___/ www.mysql.com



---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to