Currently I use the following code to create a connection to SQL

create connection conName;
datasource alltrim(odbcName);
userid alltrim(SqlUser);
password alltrim(SqlPassword)

The problem is that when the conneciton fails a dialogue is displayed. What
I want is for it to loop and try again a set number of times. I read the
docs for create connection but see no way of getting it to return a value
based on success or failure. Any idea?

- Ben

Re: Create Connection error trap by Dan

Dan
Tue Nov 29 13:46:29 CST 2005

Is there a particular reason you need a Connection stored in the database?

Have a look at SQLConnect() in the help file.

Dan

Ben wrote:
> Currently I use the following code to create a connection to SQL
>
> create connection conName;
> datasource alltrim(odbcName);
> userid alltrim(SqlUser);
> password alltrim(SqlPassword)
>
> The problem is that when the conneciton fails a dialogue is
> displayed. What I want is for it to loop and try again a set number
> of times. I read the docs for create connection but see no way of
> getting it to return a value based on success or failure. Any idea?
>
> - Ben