Home > Archive > SQL Anywhere database > April 2005 > ODBC Connection to Sybase SQL Anywhere v5.x









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author ODBC Connection to Sybase SQL Anywhere v5.x
Alex Castillo

2005-04-11, 8:24 pm

Hi..!

I'm using Powerbuilder v7.0 to write an app that will connect to a database
to be choosen by the user. Eventually I execute:

SQLCA.DBMS ='ODBC'

SQLCA. DBParm='Connectstrin
g=~'DSN='+lsDataSour
ce+';UID='+lsUserNam
e+';PWD='+
lsPassword+';AutoSto
p=YES~''
CONNECT USING SQLCA;

Where lsDataSource is a DSN taken from the local PC registry and lsUserName
and lsPassword came from a Window that works as a Login dialog.

After this code, if the login information is Ok, it connects... nice and
easy...

In the other hand, if a wrong username and password combination was used, a
window pops up asking to reenter user name and password... I don't like
that... I just like to have SQLCA.SQLCode<>0 so I can know there were a bad
username and password situation and handle things by myself...

Also, if the users insist with the wrong username and password combination
on that screen, the dbclient app stays there as if it were connected...
(even when SQLCA.SQLCode<>0)... I want the dblient app to close in that
situation.

How can I do that?

Thank you..!


Chris Keating \(iAnywhere Solutions\)

2005-04-11, 8:24 pm

Add ConnectOption='SQL_D
RIVER_CONNECT,SQL_DR
IVER_NOPROMPT' to the dbparm.


--

Chris Keating
Sybase Adaptive Server Anywhere Professional Version 8

********************
********************
********************
*****************
Sign up today for your copy of the SQL Anywhere Studio 9 Developer Edition
and try out the market-leading database for mobile, embedded and small to
medium sized business environments for free!

http://www.ianywhere.com/promos/deved/index.html

********************
********************
********************
*****************

iAnywhere Solutions http://www.iAnywhere.com

** Please only post to the newsgroup

** Whitepapers can be found at http://www.iAnywhere.com/developer
** EBFs can be found at http://downloads.sybase.com/swx/sdmain.stm
** Use CaseXpress to report bugs http://casexpress.sybase.com

********************
********************
********************
*****************

"Alex Castillo" < klmAlexCast_SlwMx@Ho
tMail.Com> wrote in message
news:425aefcc@forums
-1-dub...
> Hi..!
>
> I'm using Powerbuilder v7.0 to write an app that will connect to a
> database
> to be choosen by the user. Eventually I execute:
>
> SQLCA.DBMS ='ODBC'
>
> SQLCA. DBParm='Connectstrin
g=~'DSN='+lsDataSour
ce+';UID='+lsUserNam
e+';PWD='+
> lsPassword+';AutoSto
p=YES~''
> CONNECT USING SQLCA;
>
> Where lsDataSource is a DSN taken from the local PC registry and
> lsUserName
> and lsPassword came from a Window that works as a Login dialog.
>
> After this code, if the login information is Ok, it connects... nice and
> easy...
>
> In the other hand, if a wrong username and password combination was used,
> a
> window pops up asking to reenter user name and password... I don't like
> that... I just like to have SQLCA.SQLCode<>0 so I can know there were a
> bad
> username and password situation and handle things by myself...
>
> Also, if the users insist with the wrong username and password combination
> on that screen, the dbclient app stays there as if it were connected...
> (even when SQLCA.SQLCode<>0)... I want the dblient app to close in that
> situation.
>
> How can I do that?
>
> Thank you..!
>
>



Alex Castillo

2005-04-13, 9:23 am

Chris,

This does not seems to work with Sybase SQL Anywhere v5.x... Should it work
there?

Thank you..!

"Chris Keating (iAnywhere Solutions)" < FightSpam_keating@iA
nywhere.com>
wrote in message news:425b094f@forums
-1-dub...
> Add ConnectOption='SQL_D
RIVER_CONNECT,SQL_DR
IVER_NOPROMPT' to the dbparm.
>
>
> --
>
> Chris Keating
> Sybase Adaptive Server Anywhere Professional Version 8
>
>

********************
********************
********************
****************
*
> Sign up today for your copy of the SQL Anywhere Studio 9 Developer Edition
> and try out the market-leading database for mobile, embedded and small to
> medium sized business environments for free!
>
> http://www.ianywhere.com/promos/deved/index.html
>
>

********************
********************
********************
****************
*
>
> iAnywhere Solutions http://www.iAnywhere.com
>
> ** Please only post to the newsgroup
>
> ** Whitepapers can be found at http://www.iAnywhere.com/developer
> ** EBFs can be found at http://downloads.sybase.com/swx/sdmain.stm
> ** Use CaseXpress to report bugs http://casexpress.sybase.com
>
>

********************
********************
********************
****************
*
>
> "Alex Castillo" < klmAlexCast_SlwMx@Ho
tMail.Com> wrote in message
> news:425aefcc@forums
-1-dub...
SQLCA. DBParm='Connectstrin
g=~'DSN='+lsDataSour
ce+';UID='+lsUserNam
e+';PWD='+[color=dar
kred]
used,[color=darkred]

combination[color=da
rkred]
>
>



Chris Keating \(iAnywhere Solutions\)

2005-04-13, 11:23 am

What exactly is your transaction object settings for DBParm?


"Alex Castillo" < klmAlexCast_SlwMx@Ho
tMail.Com> wrote in message
news:425d2f3f@forums
-1-dub...
> Chris,
>
> This does not seems to work with Sybase SQL Anywhere v5.x... Should it
> work
> there?
>
> Thank you..!
>
> "Chris Keating (iAnywhere Solutions)" < FightSpam_keating@iA
nywhere.com>
> wrote in message news:425b094f@forums
-1-dub...
> ********************
********************
********************
****************
> *
> ********************
********************
********************
****************
> *
> ********************
********************
********************
****************
> *
> SQLCA. DBParm='Connectstrin
g=~'DSN='+lsDataSour
ce+';UID='+lsUserNam
e+';PWD='+
> used,
> combination
>
>



Alex Castillo

2005-04-13, 1:23 pm

Xref: number1.nntp.dca.giganews.com sybase.public.sqlanywhere.general:98815

I'm using:


SQLCA. DBParm='Connectstrin
g=~'DSN='+lsDataSour
ce+';UID='+lsUserNam
e+';PWD='+
lsPassword+ &

';AutoStop=YES;Conne
ctOption=SQL_DRIVER_
CONNECT,SQL_DRIVER_N
OPROMPT~''

Is this wrong?

Thank you..!


"Chris Keating (iAnywhere Solutions)" < Spam_NoThanks_keatin
g@iAnywhere.com>
wrote in message news:425d305d$1@foru
ms-1-dub...
> What exactly is your transaction object settings for DBParm?
>
>
> "Alex Castillo" < klmAlexCast_SlwMx@Ho
tMail.Com> wrote in message
> news:425d2f3f@forums
-1-dub...
dbparm.[color=darkred]
********************
********************
********************
****************[col
or=darkred]
to[color=darkred]
********************
********************
********************
****************[col
or=darkred]
********************
********************
********************
****************[col
or=darkred]
SQLCA. DBParm='Connectstrin
g=~'DSN='+lsDataSour
ce+';UID='+lsUserNam
e+';PWD='+[color=dar
kred]
a[color=darkred]
connected...[color=darkred]
>
>



Chris Keating \(iAnywhere Solutions\)

2005-04-18, 11:23 am

Why is there a ~? That may be causing problems.

--

Chris Keating
Sybase Adaptive Server Anywhere Professional Version 8

********************
********************
********************
*****************
Sign up today for your copy of the SQL Anywhere Studio 9 Developer Edition
and try out the market-leading database for mobile, embedded and small to
medium sized business environments for free!

http://www.ianywhere.com/promos/deved/index.html

********************
********************
********************
*****************

iAnywhere Solutions http://www.iAnywhere.com

** Please only post to the newsgroup

** Whitepapers can be found at http://www.iAnywhere.com/developer
** EBFs can be found at http://downloads.sybase.com/swx/sdmain.stm
** Use CaseXpress to report bugs http://casexpress.sybase.com

********************
********************
********************
*****************

"Alex Castillo" < klmAlexCast_SlwMx@Ho
tMail.Com> wrote in message
news:425d5e94@forums
-2-dub...
> I'm using:
>
>
> SQLCA. DBParm='Connectstrin
g=~'DSN='+lsDataSour
ce+';UID='+lsUserNam
e+';PWD='+
> lsPassword+ &
>
> ';AutoStop=YES;Conne
ctOption=SQL_DRIVER_
CONNECT,SQL_DRIVER_N
OPROMPT~''
>
> Is this wrong?
>
> Thank you..!
>
>
> "Chris Keating (iAnywhere Solutions)"
> < Spam_NoThanks_keatin
g@iAnywhere.com>
> wrote in message news:425d305d$1@foru
ms-1-dub...
> dbparm.
> ********************
********************
********************
****************
> to
> ********************
********************
********************
****************
> ********************
********************
********************
****************
> SQLCA. DBParm='Connectstrin
g=~'DSN='+lsDataSour
ce+';UID='+lsUserNam
e+';PWD='+
> a
> connected...
>
>



Alex Castillo

2005-04-19, 11:23 am

Because I'm including a ' on the string... is not supposed that if you
require to include a ' on a string you need to prefix it with a ~ ?

Anyway, which is the correct syntax for that line then?

Thank you..!

Alex.

"Chris Keating (iAnywhere Solutions)" < FightSpam_keating@iA
nywhere.com>
wrote in message news:4263c7f2@forums
-2-dub...
> Why is there a ~? That may be causing problems.
>
> --
>
> Chris Keating
> Sybase Adaptive Server Anywhere Professional Version 8
>
>

********************
********************
********************
****************
*
> Sign up today for your copy of the SQL Anywhere Studio 9 Developer Edition
> and try out the market-leading database for mobile, embedded and small to
> medium sized business environments for free!
>
> http://www.ianywhere.com/promos/deved/index.html
>
>

********************
********************
********************
****************
*
>
> iAnywhere Solutions http://www.iAnywhere.com
>
> ** Please only post to the newsgroup
>
> ** Whitepapers can be found at http://www.iAnywhere.com/developer
> ** EBFs can be found at http://downloads.sybase.com/swx/sdmain.stm
> ** Use CaseXpress to report bugs http://casexpress.sybase.com
>
>

********************
********************
********************
****************
*
>
> "Alex Castillo" < klmAlexCast_SlwMx@Ho
tMail.Com> wrote in message
> news:425d5e94@forums
-2-dub...
SQLCA. DBParm='Connectstrin
g=~'DSN='+lsDataSour
ce+';UID='+lsUserNam
e+';PWD='+[color=dar
kred]
it[color=darkred]
< FightSpam_keating@iA
nywhere.com>[color=darkred]
********************
********************
********************
****************[col
or=darkred]
small[color=darkred]

********************
********************
********************
****************[col
or=darkred]
********************
********************
********************
****************[col
or=darkred]
SQLCA. DBParm='Connectstrin
g=~'DSN='+lsDataSour
ce+';UID='+lsUserNam
e+';PWD='+[color=dar
kred]
nice[color=darkred]
was[color=darkred]
don't[color=darkred]

in[color=darkred]
>
>



Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com