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!

Report doesn't refresh 3

Status
Not open for further replies.

slimsnail

Programmer
Mar 1, 2001
7
US
I'm new to CR
When using an query recordset as the report table (VB5, CR4.6) I can't get the report to refresh. I also unchecked 'Save data with report' , but then I load the report from an ocx I get an error: Unable to connect: incorrect log on parameters. #20536. Since the recordsource is bassed on a query w/ the same fields but uses different tables, is there some other way I should refresh the report. I can refresh the data in CR when refreshing from the menu, but it won't refresh in VB code even if 'Save Data...' is unchecked.
 
slimsnail: Are you logging onto to the datasource before attempting to refresh? Have a look at LogonServer David C. Monks
david.monks@chase-international.com
Accredited Seagate Enterprise Partner
 
If you're setting the report up through code it might be the case that you should be setting the location (use something like CRReport.Database.Tables.Location = database-name.table-name) of each of the report tables - for instance I'm working against a SQL server database and need to indicate the server-name, database-name, user-name and password for each of the tables used in the report before opening it. Similarly you should set the LogOnInfo for each of the tables (indicating server, database, user + password).
Hope this helps ...
Steve
 
dcm,
No, I haven't logged on to the datasource in code before attempting to refresh. The report will load w/ old data as long as 'Save data w/ report' is checked. Are you saying that I have to log on for each refresh? The table recordset is an MSAccess query that is re-run, but each time using new tables in the same mdb as a basis of the query.
Steve
 
slimsnail: No you don't have to logon before each refresh in the same instance but you will have to logon if you want to replace saved data in the rpt with fresh data from your Access source before you refresh the report. The fact that you Access query is named the same has no effect on the contents of the rpt which takes a 'snapshot' of data at the time it is saved with Saved Data turned on and the only way to replace this is with a logged on refresh David C. Monks
david.monks@chase-international.com
Accredited Seagate Enterprise Partner
 
Hi David,
Well.... I'm beginning to get it. I see your point. I've been scouring the Seagate website for an eg. of a valid MSAccess 2.0 logonServer statement. There is some stuff re: dll's & DAO vs ODBC , but no egs. Also, would a connect statement come after logonServer? Much obliged.
Steve
 
slimsnail:I'm not sure whether you will have the Developer Help file with v4.6 but if you have search for SetLogonIngo or LogonServer method. If you don't have them let me know and I'll send you the relevant passages David C. Monks
david.monks@chase-international.com
Accredited Seagate Enterprise Partner
 
Hi Dave,
I've updated the MSAcess 16 bit dll , have also tried all of the CR DAO dlls on my system (PDBDAO.DLL, PDCTDAO.DLL and PDIRDAO.DLL) , As a log on statement I've tried w/ variations:

dbNm is a string w/ path to mdb file; have also tried statement w/o the .mdb ext
the code stops at the following statement:

connectId% = CrystalReport1.LogOnServer("PDBDAO.DLL", "MS Access Database", dbNm, "Admin", "")

w/ error code 'Unable to log on to Server', #20536
Thanks,
Steve
 
slimsnail: Not sure what's wrong as error code merely decods as database logon error. Can you try defining an ODBC connection and retry. Let me know how you get on David C. Monks
david.monks@chase-international.com
Accredited Seagate Enterprise Partner
 
Do you mean CR runtime? If so:
File:
New
Create Report
Create Report Expert
SQL/ODBC
Log On To Server
Type: "ODBC - MS Access Database"
- Prompts for name-
when picked, provides info:
Server Type: ODBC - MS Access Database
Server Name: MS Access Database
Database: "C:\Test\Trades"
User ID: "admin"
from here, fields are choosen etc.

I'm assuming that the server name used in LogOnServer would be the same as reported above. Also re: User ID - CR uses lower case Access uses proper. But I've tried both - no success.

I've also noticed that the parameter order in LogonServer in 4.6 Help does not match the indicated example.
Steve
 
slimsnail: Sorry if you thought I'd given up on you but I've only just found your last posting. The probleam appears to be that you are mixing 2 methods i.e. your code refers to PDBDAO.DLL - the Data Access Objects driver but your logon server is an ODBC connection. Try changing your code to read PDBODBC.DLL and this may succeed David C. Monks
david.monks@chase-international.com
Accredited Crystal Decisions Enterprise Partner
 
David,
Thanks for your considerable attention. However this doen't work either. I've mailed Seagate, but they haven't been able to show me a programming example that is able to refresh a report using ab Access2.0 table/Vb5, and this should be a simple coding example. Their programmer said he thought it is due to an incorrect odbc dll reference in the registry when loading Vb5. Like anyone else, I can't wait a month to deal w/ this kind of problem. Also the Crystal helpfile is one of the worst I've had to deal with. I've thus up upgraded to VB6 and am working w/ the relatively simple DataReport Designer. But at least it works. I'll probably go for a 3rd party. Seems silly that MS would add a control that is not compatible w/ DAO. Maybe they have some sort of contract commitment w/ Seagate. I have spent prob. 30 hrs (really) scouring the Seagate site for an example. Seems like Seagate would have plenty of coding examples against an actual database. This confirms my feeling that Crystal is great as a stand-alone only.
Thank you kindly.
Steve K.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top