Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

I am having difficulty with the PENthTableLogonInfo API call. pls help

Status
Not open for further replies.

JasonHMIS

MIS
Feb 16, 2001
2
US
Hi I am using the function to change the datasource of the report based on the datasource my customer is currently in. I use the following cd to do so.int l_value
int rcode
int errcode
string errortext
string l_docname, l_named, ls_path, ls_server
n_cst_filesrv lnv_filesrv
logoninfo li

li.size = 514
If gnv_app.is_servername = 'none' then
li.servername = gnv_app.is_company
Else
li.servername = gnv_app.is_servername
end if

li.databasename = gnv_app.is_database
li.userid = gnv_app.is_username
li.password = gnv_app.is_password

engineopen = PEOpenEngine()

f_SetFileSrv(lnv_filesrv, TRUE)
ls_path = lnv_filesrv.of_GetCurrentDirectory()
select report_dir into :ls_path from Control_Owner_lot;
If isnull(ls_path) or ls_path = '' then
ls_path = 'C:'
End if
//***********************************************
//set the default directory
rcode = lnv_filesrv.of_ChangeDirectory(ls_path)
//
l_value = GetFileOpenName("Open Report"/* this is the title of the dialog box*/, &
+ l_docname, /* path*/ &
+ l_named, /* filename*/ &
+ "rpt", /* extension*/ &
+ "Reports (*.RPT),*.RPT," &
+ "All Files (*.*),*.*")
IF l_value = 1 Then
reportfilename = l_docname
End if

if engineopen <> 0 then
job = PEOpenPrintJob(reportfilename)
if job = 0 then
messagebox (&quot;Error&quot;, &quot;Print Job Could Not be Opened&quot;)
PEClosePrintJob(job)
return
end if
else
messagebox (&quot;Message&quot;, &quot;Engine Not Opened&quot;)
PEClosePrintJob(job)
return
end if

if job <> 0 then
rcode = PESetNthTableLogonInfo(job, 0, li, True)
if rcode = 0 then
messagebox(&quot;Error&quot;, &quot;Logon Info Not Set&quot;)
PEClosePrintJob(job)
return
end if
else
messagebox (&quot;Message&quot;, &quot;No Job Opened&quot;)
PEClosePrintJob(job)
return
end if

The datasource is an ODBC Adaptive server datasource.

The values are
li.size = 514
li.servername = h_000 (The odbc datasource name)
li.databasename = h_000 (name of the DB)
li.userid = username
li.password = password

If anyone can shed some light on what I am doing wrong I would appreciate it.

Thank you

 
JasonHMIS: It moght help if you could detail what you are experiencing when you try to execute your code (error codes, messages, track etc.) David C. Monks
david.monks@chase-international.com
Accredited Seagate Enterprise Partner
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top