I've recently discovered that I can use P9 as a comfortable, familiar
reporting tool for the data that I am forced to port to our new sql server
environment until such time as we find a 'new' tool to support our batch and
web-based reporting needs. Now I am trying to automate some processes so
they are simple forms that request a parm or two and then run an sql query
and open the desired report. The problem is that my db.open statement
requires the password - which if I enter it interactively allows my process
to run just fine. I've read the help files, but the only indicator there is
that I need to consult my server info and my dba has no info to provide me
on this. Hopefully , someone out there has done this already.
Here's what I have that works perfectly - except it asks for a password.
;*************
; open the database (didn't work until I did this)
db.open(":sql_pbf:")
;*************
; define my sql variable with
sq = sql
SELECT cast(p.Proj as char(6)) as Proj,
cast(p.Phase as char(1)) as Phase,
cast(p.Approp_Num as char(8)) as approp_num,
cast(p.Segr_no as char(3)) as segr_no,
(case when p.budget_type = 'PLAN' then p.Budget_amt else 0 end) as
budget_amt,
(case when p.budget_type <> 'PLAN' then p.Budget_amt else 0 end) as
Cert_amt,
p.Alloc_amt,
cast(m.descprt1 as char(40)) as projtil1
FROM pbf.dbo.PBFDTL p, m4ext.dbo.m4ext1 m
WHERE p.proj = m.proj and p.proj = ~sel_proj
ORDER BY p.approp_Num,
p.Segr_no,
p.Proj,
p.Phase
endsql
;************
; now run the query
sq.executesql(db)
;*************
; and open the report to show the results.
r.open(":jgs:pbfdtl2_sum")
>From a debug session, I've determined that the db.open statement is what
causes the user prompt to enter e a password. From the Help I've learned
that I COULD provide a parm that contains db session vars, but I don't know
what it should look like. Help! this is a MS Sql Server database that I am
trying to get to.
da["password"] = "my-actual-password"
da.open(":pbf_sql:",da)
And it worked!
Perhaps this will help someone else out.
"Jim Giner" <gin...@sysadm.suny.edu> wrote in message
news:416fbd0a$1_1@cnews...
> Thanks for the info, but as I said (just before you did) I found
> out by sheer luck how to do it.
Yes, I saw that after I'd posted.
> Actually, I don't even need the username for some
> reason.
No doubt you'll be figuring that out right about now. <g>
--
Larry DiGiovanni
Digico, Inc
IT Consulting and Staffing Solutions
www.digicoinc.com
Check out www.thedbcommunity.com for Paradox resources
Is it specified in the alias definition?
--
Bertil Isberg - CTECH
Paradox buglist:
online: http://w1.826.comhem.se/~u82608896/
FAQ newsgroup: corel.wpoffice.paradox-faq
Password will not be saved in the alias definition. Username is. When it
is, it will be used when you open a databasevariable unless you specify
another one.