Henry Schubel 5 Light Poster

I was here looking for a solution that I didn't find, but have since figured it out so I thought I'd post it as I doubt I'm the only one who has had the need. The issue is - How do you have Crystal print to a 'Named Printer' without resetting the Windows Detault Printer, in other words - my default printer is a workgroup laser, and I also want to print to a small thermal label printer. The OCX provides the appropriate properties to do so, but it isn't just setting the Named Printer. Per Crystal Help, you have to set all 3 properties or it doesn't work. You must set...
Printer Name
Printer Port
Printer Driver

I was surprised to find too, that this particular printer was attached to a USB port and the printer driver is USBprint.sys, a generalized driver. The trick in my application, however, was different desktops using different versions of Windows. In one case the root directory was c:\Windows and in another c:|WinNT so be sure you locate the driver. I had to externalize these parameters for max flexibility, but it does work. The only downside I've seen is a bit longer delay than when Crystal initializes for the first report. It's like Windows pauses and says "You want to do what?" Then after it's checked your parameter it goes ahead and prints for you. the slightly slower response isn't worth talking about.

Henry Schubel 5 Light Poster

I have a legacy VB6 application; simple VB6 front end and Access backend database. Works fine on Win 2000, WinXP, Vista, and 32-bit Win7. Bought a new laptop and everything seems to be shipping with 64-bit Windows now. Out of the box, the application worked fine after I manually re-registered a couple of the OCX's for controls. Then Windows went out and did an automatic update of windows, and Microsoft obviously replaced the ADO (Active Data Objects) library, which is where the code is for accessing various databases. The internet is littered with posts about how the newer ADO library kills the functionality of applications that were working just fine previously. And of course, trying to get Microsoft to acknowledge it.... forget it. Does anyone know a fix to allow you to revert back to the original ADO library shipped with 64-bit Win7 ?

Microsoft's marketing lingo... "It Just Works" Ummmmmmmmmm, not it doesn't Microsoft !

jlego commented: but it does work - if you have money to upgrade every time they do! +3
Henry Schubel 5 Light Poster

Yeah right. You don't need anyone's help here to get a trial key.
You can ask the vendor who will gladly give it for a legitimate trial user.

Henry Schubel 5 Light Poster

hi, Sailesh
i would be very gratefule if you can help me with the CRXI developer key coz i can't affrod it anymore. have finish my vb apllication remain the deployment i am stack for 6months can't get the key.
yahayya2000@gmail.com
Regards.
kumar.

As a Developer, I would think you would understand the value of one's work and not be here blatantly asking to voilate copyrighted software. Shame on you!

Henry Schubel 5 Light Poster

What's it look like? It's a thing of beauty !

What are you interested in. I'd be happy to share.

Henry Schubel 5 Light Poster

I found a workable solution to the error. My user has SP1 applied to their Vista machine, and we still got the error. You can right-click on the exe itself, select a compatability mode setting in the Security tab. The program works fine now. I am amazed however.

Henry Schubel 5 Light Poster

I'm not even sure where to post this, but since I wrote the code in VB6, maybe here...

This is really more of an Outlook problem, but what I'm doing is programatically creating email. Here's the problem.

My VB6/Access application is installed on a Vista machine, and the host machine has Office 2007 with Outlook 2007. In Outlook, you can host multiple identifies, as you can with Outlook Express, but in the latest Outlook, you Send/Receive for all identities as the same time. When my program creates an email, it's always creating it with an identity not intended as the sender of the email. I need a way to tell Outlook, either programatically or with a setting, which identity to use as the sender. Second, with each email, the user gets a message box that forces them to identify the email type. When the message box appears, the email type has the addressees email address in it, and you have to manually change it to SMTP before you can send the message.

So...I need to be able to tell Outlook which senders ID to default to, and I need a way to specify the format as SMTP. If I can't do that, I get a message box for every email generated which kinda defeats the purpose of generating the mail programatically in the first place.

Ideas?

Henry Schubel 5 Light Poster

There is another post out here on this... saying that Vista puts some boot related files in the "primary" partition, and that if you delete that first partition, as you suggested you did, you've lost the boot files. I'd try the Partition Magic program to see if you can format that first partition, OR try the Boot Magic programs to see if you can either repair it, or install the PowerQuest Boot Magic program to get around it. Don;t you love Microsoft ?

Henry Schubel 5 Light Poster

If you're running XP and go to install Vista, the install process will allow you to make the machine duel boot as long as you have enough disc space and install Vista in a new partition.

On the item of sharing documents... I used to use Partition Magic, one of the disc mgmt programs around, to make all my dual boot machines, but I also use it to dice up the hard drive, usually before I put an OS on it. What I do is create a logical drive that I give the disc label EXTRA to, and both partitions can see the logical drive and access files from it. Another reason for doing this too, is that if your OS gets corrupted, you can still access your important files from the OS in the other partition. Almost invarriably...the logical drive isn't touched if the OS gets corrupted. I've been doing this for years.

I used to teach and I've had my laptop configured with as many as 4 operating systems on it. PM would supply a boot manager you could use, allowing you to select which OS you want to boot.

Henry Schubel 5 Light Poster

but has anyone tried to Install Win XP on a machine already running Vista ?

Henry Schubel 5 Light Poster

Has anyone taken a machine running Vista, then tried to add XP as a second OS to dual boot ?

Henry Schubel 5 Light Poster

I have another idea and more information on this VB6/Vista issue. I have to admit first, I don't like Vista and I'm still using W2k and XP for development desktops, but... It's come to my attention that all errors aren't as obvious as others. In Vista, you need to look at the Event Viewer as a more detailed source for resolving errors. I've been chasing this Method '~' of object '~' failed error for days now, and one of my users showed me the Vista Event View for appl errors and it's reporting a dll problem. At the moment, I think I have a version issue with the DLLs, but at least the new information has me pointed in a new direction to try to resolve this.

Henry Schubel 5 Light Poster

First of all, as jbennet says, Microsoft did commit to supporting VB6 and it DOES so indicate that on their web site.

I tested installing VB6 on a machine with a virgin copy of Vista Home and it installed fine. I wiped the machine clean, and reinstalled Vista to have a virgin OS for testing Install Scripts and I ran into the same problem so many have run into. I still have to support some old applications that are using old VB6 controls, and I too, searched for hours for a solution to some of the problems. The solution I found that was most sickening was that the controls don't register properly, BUT.... if you just reference the OCX with regsvr and UNREGISTER the control, then immediately re-register it, it worked fine. Example for FlexGrid
Regsvr msflxgrd.ocx /u (to unregister it) then
RegSvr msflxgrd.ocx (to re-register it)

What I am having most difficulty with, and it seems several hundred others as well, is that some apps, installed on Vista, are having an unresolved problem with ADO. I have a simple VB6 front end with an Access database backend, and ADO fails on some Vista machines. I'm still searching for a solution to ...
Method '~' of object '~' failed

Any ideas out there ?

Henry Schubel 5 Light Poster

Try UN registering the ocx, then immediately re-register it.

This fixed most of my problems with Vista. It's a Vista registration issue, not your code.

Henry Schubel 5 Light Poster

I wasted hours and hours on the same problem only to find an obscure solution. There is a problem with registering an ocx and some DLLs with Vista. After you install your program, use Regsvr to UNregister the dll, then immdiately re-register it. For the ocx problems I had, just reregistering the ocx corrected the issue.

The following example for the FlexGrid conbtrol...
get a command prompt and enter...

RegSvr32 msflxgrd.ocs /U

The ocx should UNregister. Then immediately....

Regsvr32 msflxgrd.ocx

Then try your application.

Henry Schubel 5 Light Poster

if i have installed CR 11 which serial key is on the CD, can it be categorized as developer key?
Thx for the help, and it would be very helpful for me if the answer is sent to my email on han_li3m@yahoo.com.sg
Thx a lot. God Bless Us.

You need to purchase the Developer Edition.

Henry Schubel 5 Light Poster

The first thing I have to tell you is to consult the VB migration guide and make sure the control you are using is still supported with Vista. There is a list of controls that are still supported, and a list that are not. I've already changed applications to drop one control in favor of another because of obsolete controls.

Notwithstanding, I've spent most of the last 7 days trying to get a working install script, created with Wise Installation Express for Windows, to no avail. Each attempt and new variation of the install script left me with an OCX that wasn't properly registered. The solution is sickening.

After you run your install script, go in with Regsvr32 and UNregister the OCS, then immediately Register it again. My application worked fine with this ugly solution. As for Vista and "It Just Works" ... I'd really like to have a few heads at Microsoft for wasting so much of my time on this.

Henry Schubel 5 Light Poster

I've never had to append before, but to "overwrite" as you say, just delete the file before you re-create it. In VB6 its just

Kill Filename

where Filename is a fully qualified file name.

Henry Schubel 5 Light Poster

Look up the Selected property for the ListBox control.


Dim i as integer

For i = o to lstBox.ListCount
If lstBox.Selected(i) then
lstBox.RemoveItem i
Exit For
Endif
Next i

leedsy7 commented: Very Helpful, Solved my problem straight away :) thankyou +1
Henry Schubel 5 Light Poster

I want to chime in with something too Joe. One of the points Darkang made was good diagnostics, and I've been telling students for years that a good language processor provides good clear messages. Compare that to some of the database products and you'll get a headache. When I got out of college, the languages of choice were Basic, Fortran, and Cobol. With mainframes still in the mix, there is actually still a market for cobol programmers, but given your age and starting point, I certainly wouldn't recommend you start there, I just wanted you to hear some history. As PC's and PC based applications came into vogue, so did the newer languages. I faught the college I taught for to get updated and it was an uphill battle. At the time, Powerbuilder was the "buzz" and newest toy, but it had a steep learning curve and was too expensive for an academic setting. That fact is what gave Visual Basic its opening. Earlier, HP was to become the number 2 computer company behind IBM. HP's HP-3000 supported Basic, Fortran, Cobol, and Pascal, and in fact, HP re-wrote it's operating system in Pascal, and viola, Pascal became the buzz for a while. Meanwhile, VB is going through it's iterations. As the midrages machine died their slow death, and Server software became stable enough platforms for business to rely on, the other languages took hold for good. Even only 3 years ago, I would have told you to learn VB and …

darkagn commented: Great historical info and good to hear your point of view from your experience +1
Henry Schubel 5 Light Poster

I wrote a VB6 application to generate email for my application.
I can generate plain text messages just fine, but I really want to have the message in RTF format. Does anyone know how to generate the text in Rich Text Format? Somehow I think this is going to end up being a property or something simple.

Henry Schubel 5 Light Poster

You're not going to get anywhere until you successfully access the database. Isolate the code and single step execution to find out where the logon is failing. What type of DB are you accessing anyway? MS Access or SQL Server ?

Henry Schubel 5 Light Poster

I don't use VBA much, sorry.
For a range, like a date range, I make two parameter variables FromDate and ToDate, then just use them in the record select formulae.

Henry Schubel 5 Light Poster

I think I hear the cash registers at Business Object cha-chinging !

Henry Schubel 5 Light Poster

I am running two versions of Crystal Reports on the same machine with VB6. Versions 7/8/9 all use similar DLL's. V10 and V11 are major upgrades. Given your problems, I'm beginning to wonder if you have a legal copy of Crystal V11.

Go find the thread I started "How to launch a Crystal 11 report from VB6"
I posted all the code, references, etc.

Henry Schubel 5 Light Poster

Second, I access a SQL Server database via ODBC. Since I can't predict or dictate what the SQL Server (that's the SQL Server, not the Windows Server) will be, the name is passed to the program as a parameter in the desktop shortcut.

Preliminary:
I use a separate UserID and password for all my crystal reports, and I set up a DSN with ODBC Administrator to define it. I call it something cryptic, but the gist is I usually call the DSN 'CRSS' which stands for Crystal Reports SQL Server, and I don't use that ID for anything except crystal, and in general, the User ID has READONLY access (Select access) only, to all tables in the database. It's readonly, so you can't hurt anything, and unless you're really paranoid about security/privacy it won't be a crisis if someone gets a hold of that User ID and password combination. Of course, I don't tell anyone either. It is used strictly inside my programs to facilitate crystal. I use the DSN 'CRSS' because if you have to move 100 reports to another machine, like one would have to do when installing a commercial product, all you have to do is define that DSN on the target machine and all your reports will work. Therefore, this is actually one place in life where being cryptic is a good idea.

For VB6

Three Project References:
Crystal ActiveX Report Viewer Library 11.0
Crystal Reports ActiveX Designer Run Time …

Henry Schubel 5 Light Poster

There will be two posts minimum...
First, I'll refer you to the Knowledgebase Articles that give the needed information, and second I'll give you code samples to run a report given the methods I use. Specifically, I access a SQL or Access database via ODBC, but either database will work with the code samples.

This basic document is a good place to start.
http://technicalsupport.businessobjects.com/KanisaSupportSite/search.do?cmd=displayKC&docType=kc&externalId=http--supportbusinessobjectscom-communityCS-TechnicalPapersNoNav-cr9ocxtordcpdfasp&sliceId=&dialogID=14150208&stateId=1%200%2014152193

The biggest changes were the new ConnectionProperties in version 9.0 and later.
They are explained in the following document:
http://support.businessobjects.com/communityCS/TechnicalPapers/cr_query_engine.pdf

The RDC code is described in:
http://support.businessobjects.com/communityCS/TechnicalPapers/cr_rdc9_connectionproperties.pdf.asp

If you will be running reports from older versions of crystal, I recommend using the property .DeleteAll and add the new properties in for ODBC. Each connection does have different properties as it now reads the driver; ODBC, OLEDB or Native.

The information is there, but I did not find these articles particularly user friendly.

Henry Schubel 5 Light Poster

Give me a few minutes and look for for a new post. I'll start a thread called "How to launch a Crystal 11 report from VB6". This is a nuisance to too many people. Stand by.

Henry Schubel 5 Light Poster

Find the thread "How to add Crystal Report 11 in VB6" and read it. There is a topic in the Biz Objects that is a cook book for getting you through the connection problem. I can't remember what the topic is, and it's a bit obscure, but everything you need is in the article. If you still have trouble AFTER reading the article, post again.

Henry Schubel 5 Light Poster

The Asterisk * is the wild card for the LIKE operator in Access.

Henry Schubel 5 Light Poster

Hello Henry pal,

I am not working on the Microsoft BIBLIO.MDB database file.
I have made a seperate database file of my own. An this is not an academic task . Its simply my interest to know more knowledge the right way in this techie line.

So, please could u clear my doubts as per the asking question put up in my previous post....??

Awaiting ur enriched response....


I did reply. There isn't any magical way to report on two unrelated tables just so you can save paper. Come up with another strategy.

Henry Schubel 5 Light Poster


Actually, i have to show a report on market competetors for Book Titles. for an X book publishing company.

And i have 2 cases that can come under them:
1. A publishing company's reps discussing books with professors of
various institutes. This can involve discussions of certain publishing
competetors.
2. Books recommended by Professors to students in an institute. This
also could involve books from market competetors.


-----------------
It sounds increasingly likely to me that you are using Microsoft's BIBLIO datebase and that you are working on an academic problem.
I don't think that's what this forum is for.

Henry Schubel
Associate Professor of Computer Science

Henry Schubel 5 Light Poster

see Henry , the UNION & INTERSECT clause will not apply in this case...
becoz the 2 table that will be used in displaying the records on both the sides of teh report are completely different and are not linked at all.

And i thought that the UNION & INTERSECT clause was used to query some common records among both tables...But these 2 tables are seperate entities.
Is it possoble for me to have ur YAHOO messenger ID so that i can settle somethings out right now...pleeeeeasssssee u can PM it to me.

I don't use Messenger.

If there is nothing to relate the two tables, why would you want the contents of two unrelated tables on the same report?
You should come up with another tactic.

Henry Schubel 5 Light Poster

There isn't any simple solution to this problem, but maybe I can educate you a bit. Look up the SQL commands Union and Interesect to see if they may apply in this situation. When faced with this, sometimes I make a new temporary table just to help with the retrieval of this kind of query. So, also look up...

Select Col, Col from Table Into NewTable

REgards.

Henry Schubel 5 Light Poster

I gr8tly appreciated ur help Henry buddy,

OK ..thank u so much for ur assistance. So i am confident enough that i can go ahead with the deployment stuff.

But....

Before that i have a particular report to make which refers to this new issue: (2nd topic)

"Crystal Report 11 and Visual Basic 6.0 sql query...."

Please read it and help me....Thanks in advance

I CAN'T FIND YOUR OTHER POST.

Henry Schubel 5 Light Poster

Hi all,

Wondered if you can help with this problem. I have created a report in Crystal reports that is accessed by an application created in VS.net 2005. The report relies on the user inserting parameters to filter the report but when the report is accessed via the application the parameter prompt page renders terribly.

Any help with this will be appreciated

nesh

I know exactly what you mean! I thought I had an incompatible version of HTML since that is what the page is rendered with. I don't know what they do, but if you're using InstallShield or the Wise Installer just include the proper Merge Module and that problem will go away. I'm guessing that Biz Object too couldn't rely on what version of html would be out there so they did their own thing. Use the Merge Module and you'll get past the problem.

Henry Schubel 5 Light Poster

I still didn't get u. R u asking me the question that whether it is correct or not....or are u clearly saying that the STEPS i have mentioned are correct. And henc ei can now focus on deploymnt part

You got it right. Work on your deployment.

Henry Schubel 5 Light Poster

Hi..and thanks for ur reply
I have a new situation here...with CR 11 and VB6

==============================================
CRYSTAL REPORT 11 Report Designer part
==============================================
I have designed my report in Crystal Report 11 product using the Report Designer. And i have NOT used the standard wizard that pops up for designing the reports.

STEP 1:
I have opened a blank report and used the Database Expert tool for connecting my MS ACCESS (.MDB) database file and also selected the tables that would be used in report generation.

STEP 2:
Dragged & dropped the fields from the Feild Explorer's database tables and placed it on the Report Designer window. Like this i have designed my reports.

STEP 3: Saved the report as .RPT extension


==============================================
Visual Basic 6 Code View part
==============================================
STEP 1:
In VB6 code, i have used the ".SQLQueryString" property

SYNTAX: ".SQLQueryString <string_variable>"
NOTE: the string variable contains the SQL query statement.

STEP 2:
setting report location:
SYNTAX: ".OpenReport(App.Path & "\ABC.rpt")"

STEP 3:
setting .MDB database location:
SYNTAX: ".Database.SetDataSource (App.Path & "\XYZ.mdb")"

STEP 4: There is some other code also. Main thing is that now my reports are being generated perfectly using the user selected item from a combo box's dropdownlist on a vb form window.


QUESTIONS:
========
1. I will be adding the CR11 Merge Modules to my setup builder, as given on the Business Objects site.

Henry Schubel 5 Light Poster

Then something went wrong with the install. You have the correct components identified, but you have to have them references in your VB project for Crystal to work.

Henry Schubel 5 Light Poster

Hi..

I have a table: PROFESSOR in ms access, that has 2 fields: "Name" and "Location". The table has 10 records.
And i have made a vb form with a combo box that will show a list of available locations from the database table, when it is dropped down.

So, the end user will select a location from the cbo on the form and i want that to be used as the basis of the report to be generated.

QUESTION:
========
1. How do i pass the value (i.e the location selected by the user) to the report designed ?

2. If i want the report to be generated based on the user's selection of "Location", then do i use the standard wizard which is popped up when the Crystal Report 11 designer module is added from the project exploere in vb6 ??

Pls answer the questions in order of them stated above.
Help will be surely appreciated...:cool:

#1 You pass off your parameter value as a formula in the RecordSelection property.

#2 Don't design the report with a propmt for the parameter. You're going to pass off any record selection criteria via the RecordSelection property. You're trying to mix two techniques that don't mix.

Henry Schubel 5 Light Poster

No one said you can't call Crystal from VB, there is just a lot of confusion on how exactly to call CRv11 from VB6.

I don't know what you question is regarding "keys". Elaborate if you have a question.

Henry Schubel 5 Light Poster

If you have any more grief with it, make a post. I can post code samples if need be.
Once you look at the code needed, a lot of things make sense, but it's all in that one document anyway.

Henry Schubel 5 Light Poster

If you haven't gotten past this issue, I can sympathize with you. It took me many hours as well. The answer is actually in BizObjects Knowledgebase, but it isn't so obvious what to look for. Query their KB for "OCX RDC" and find the technical paper "Migrating from the OCX Control to the Crystal Reports 9 Report Designer Component (RDC)". The RDC is essentially unchanged from versions 9 thru version 11, which is what throws many off. Get the document and read around page 17 for sample code. I have all my reports pointing to a named data source or DSN. Your VB program must also step through and assign the DSN to each table in the report. See sample code on page 44 of the document.