Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

VB, Oracle and Crystal Reports.......URGENT !!!!!

Posted on 2002-03-09
16
Medium Priority
?
1,097 Views
Last Modified: 2007-12-19
hi experts,

i'm using crystal reports ver 4.5 for reports with VB as front end and oracle as back end.  I connect with a microsoft userconnection object to oracle and perform all the sql operations. While generating the reports using the crystal Reports ocx, the method LogOnServer works fine. I use LogOffServer method in the next line, once i display the needed report as below,

CRpt.LogOffServer (connID, False)

But the vb compiler displays a message as "Expected:=" . But i'm sure that LogOffServer is not a Function but a sub and no return value can be obtained.
My versions are Crystal Report 4.5, Vb 6, oracle 8.
Please help me.......and this is urgent.

thanx in advance

0
Comment
Question by:pramodkumar
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 8
  • 8
16 Comments
 
LVL 46

Expert Comment

by:aikimark
ID: 6852819
try:

CRpt.LogOffServer connID, False

or

Call CRpt.LogOffServer (connID, False)
0
 
LVL 46

Expert Comment

by:aikimark
ID: 6852822
Please attend to your open questions.
0
 

Author Comment

by:pramodkumar
ID: 6854559
hi aikimark,
thanx for responding

>>try:

>>CRpt.LogOffServer connID, False

already tried that...doesn't work


Getting problem with LogOnSever now. Can please tell me the ".dll" file i have to use with this?
"pdsodbc.dll" gets me the error "unable to logon to server"

i'm using oracle as backend
waiting for answer...
thank you


0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
LVL 46

Expert Comment

by:aikimark
ID: 6854621
I recommend reinstalling Crystal Reports.  All the DLLs you need will be installed.

Did I answer your original question?
0
 

Author Comment

by:pramodkumar
ID: 6858042
even tried that for no use...
is that a bug in 4.5 version???????
0
 
LVL 46

Expert Comment

by:aikimark
ID: 6858138
What problem are you getting with Logonserver?
0
 

Author Comment

by:pramodkumar
ID: 6865667
ok aikmark, i've installed Crystal Reports 7 and no probs with logonserver, i can log on to oracle db but i get an error with,

Crpt.Action=1

while called this report, i get a flash view of the report but get an error.The error says something like "report is read only"

can u please help me with this one please?
0
 
LVL 46

Expert Comment

by:aikimark
ID: 6865713
Does it mean that the report file (.rpt) is read only?

Can you see the report?

Do you get the error messsage when you are doinging something to the report preview?
0
 

Author Comment

by:pramodkumar
ID: 6868103
Does it mean that the report file (.rpt) is read only?
>>>OOOOps i'm very sorry aikimark, it is reverse, i mean the error says "field is write only"

Can you see the report?
>>> i can only see the report for a second and this error appears

Do you get the error messsage when you are doinging something to the report preview?
>>>>> no, i don't get any error in preview mode
0
 
LVL 46

Expert Comment

by:aikimark
ID: 6869516
Your problem is stumping me.  Please list the VB code that sets/accesses the CRW properties, both before and after the .Action=1 statement.
0
 

Author Comment

by:pramodkumar
ID: 6871835
oops, sorry if i'm troubling you...
this is how i've tried so far

conID% = crpt.LogOnServer("pdsodbc.dll","mydsn","","username","pass")
crpt.Action = 1
call crpt.LogOffServer(connID,False)

i write above code mnu_Report_Click() sub, i mean i need to get the report when the menu item is clicked.

But remember, i'm already connected to the DB using an user connection and it is active.

i get error at LogOffServer, when the application is run at most of the time as it cannot Log Off from the server after showing the report, as there is an active connection(user connection).




0
 

Author Comment

by:pramodkumar
ID: 6871844
I've written as LogOffServer(connID%,True) - here there is an error while writing to you
0
 
LVL 46

Expert Comment

by:aikimark
ID: 6872082
try:

crpt.LogOffServer("pdsodbc.dll", "mydsn")
0
 

Author Comment

by:pramodkumar
ID: 6874357
crpt.LogOffServer takes 2 parameters -
LogOffServer(connectionID reutrned by the LogOnServer, Bool value for logging off all active connections (True) or only the connection indiacated by the connectionID (False))
is that right????????

will the code given by you will work?????? anyway i'll try that for u.....
and need not worry about your marks......i'll may also give more than 150 !!!
thanx for staying with my question for such a long time....
0
 
LVL 46

Accepted Solution

by:
aikimark earned 300 total points
ID: 6874466
The LogOffServer documentation I read had two non-optional parameters as I suggested.  My documentation might have been wrong or out of date.  It shouldn't hurt to try.  

Also, read http://support.crystaldecisions.com/communityCS/TechnicalPapers/logon_ocx.pdf

=====================================
The more I read, the more I'm inclined to suggest that you don't use the LogOnServer or the LogOffServer methods.  Just supply your userid and password with the connect string.
0
 

Author Comment

by:pramodkumar
ID: 6907617
though i could not solve my problem, i got valuable info regarding my question. Thanx for staying for a long time with my question, i'm awarding you 100 points for your help...if needed my mail is kpramodrai@hotmail.com
thax a lot !!!
bye

pramod
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses

618 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question