conection to progress database(9.1a) on UNIX using web speed(3.1c) on NT

ycy

New Member
Hi all,
Please can anyone tell me how to conect to a UNIX database through webspeed on Win NT without specifying it in the broker.

I have connected the Win NT database through the broker.

i have tried the connect command as below for the UNIX database.

connect -db dbname -N tcp -H hostname -S servicename.
if connected("dbname") then
do:
display "Yes".
end.
else
display "No".

it displays "yes" on the web but the data captured is not of the UNIX database but that of the Win NT database.

thanking u all.
 
Do the two databases have the same "dbname"? If so, you need to change the db connection detailed in your WebSpeed startup to the UNIX database.

If WebSpeed only talks to the UNIX database, then just set the connection up as a pf and add to the agent startup parameters.
 
Hi Richard,

Well the Win NT database has a different name than the UNIX database. I just wanted to connect the UNIX database for a comparision with the Win NT database and then disconnect the UNIX database without changing the parameters given in the broker start up. I used the connect command which showed that the UNIX database was connected but when i tried to use the UNIX database for a querry for eg.

connect -db unix-dbname -N tcp -H host -S service.
if connected("unix-dbname") then
do:
find first unix-dbname.customer no-lock no-error.
disp unix-dbname.customer.name.
end.

it gave an error invalid database name.

here i am trying to connect through progress 4GL code and not by defining it in the broker startup parameter.

so can u tell me what could be the problem there.

regards.
 
Firstly, you need to connect no-error to be able to use the connected function.

I have not tried dynamically connecting to dbs at runtime, I am unsure as to whether WebSpeed can do this, as during each web request it spawns an agent (which is where the db connect params are for my app). Not sure if an agent can connect to another db while it is running.

Silly question, but have you made sure the dbname and service number are in your hosts and services file, and you can connect from a 'straight' client session using the exact same parameters?
 
Hi,

You cannot connect a database and access it in the same procedure (see Progress documentation on the CONNECT statement).

You will need to do something like this:
Code:
CONNECT -db unix-dbname -N tcp -H host -S service. 
RUN test.p.

/* test.p - separate procedure */
if connected("unix-dbname") then 
do: 
find first unix-dbname.customer no-lock no-error. 
disp unix-dbname.customer.name. 
end.
As said, see the progress documentation for complete info on the connect statement. Also you may have to create an alias for your database to make sure you can run the procedure (in case of the example test.p) with either of the connected databases. Apart from that you must - of course - make sure the schema of both databases is the same, otherwise you may get CRC errors (if you run compiled code).

HTH.
 
Hi,
I tried to put it into an external procedure but it gave me the same error unknown UNIX database name.

When i tried to recompile the program an error is displayed while compiling using the workshop that the customer table is ambiguious to the Win NT and UNIX database which shows that the UNIX database is connected. So what could be the problem.

also can we start and stop a broker using a progress code.

thanks for the help
 
Back
Top