Reputation: 43
When I tried to connect to data base using .pf file in OpenEdge progress 4gl it is throwing error 1006.
Error Message: rfile.r Database dbname not connected. (1006)
Could anyone tell me how to handle Error 1006 ?
Upvotes: 0
Views: 741
Reputation: 14020
A .pf file is just a collection of startup parameters. There is nothing special about putting them in a .pf file except that it might be convenient to organize them as a group in such a way. It is also helpful because it gives you a simple way to comment on what the parameters mean and (perhaps) why you are using the values that you are using. One downside is that you cannot use shell variables inside of .pf files, everything has to be explicitly hard coded.
The error "program.r database dbname not connected. (1006)" means that your program references database objects in a database that is not yet connected to your session. If you are getting this error at startup then it is very likely that you have simply omitted a db connection on your command line (or in your .pf file). To specify a db connection in a .pf file:
# sample.pf
#
-db sports2000 # name of the database to connect to, no path if -H & -S are used, otherwise use the full pathname
-p program.r # procedure to run at startup
# -H hostname # host and port are optional if your are connecting to a local db
# -S port
Upvotes: 1
Reputation: 3909
Could anyone tell me how to handle Error 1006 ?
The short answer is: you need to connect to the database.
You can do this via the command-line ( prowin -pf mydb.pf
) or via ABL in a procedure that runs ( CONNECT -pf mydb.pf
).
If you do connect in ABL code you cannot reference the newly-connected database in the same program. You must connect in one program (.p/.cls), and then run another program, to reference that database.
Upvotes: 3