SQLQuery specifies the SQL query string used by the specified report.
Syntax : [form.]Report.SQLQuery[=SQLQuery$]
For example:
CrystalReport1.SQLQuery = “SELECT authors.au_id, authors.au_lname,authors.au_fname FROM pubs2.dbo.authors authors WHERE authors.au_lname >‘Madison’"

You may only change the WHERE, FROM, and ORDER BY sections of an SQLquery.
Although the property requires that you enter the entire SQL query, the SELECT section must not be different from the original query in the report.

**
To change the ORDER BY clause, you must place a carriage return and
linefeed characters after the WHERE clause and before the ORDER BY clause
in this way: CrystalReport1.SQLQuery=”SELECT...FROM... WHERE...” + CHR$(13) + CHR$(10) + “ORDER BY...”
This property is active only if you are using an SQL or ODBC data source in your report.
**


You can take out the next from Your code
PrintFileType specifies the type of print file to use when printing a report to a file.
Syntax : [form.]Report.PrintFileType[= FileType%]
For example, if You use :
CrystalReport1.PrintFileType = crptCrystal
A standard Crystal Reports (RPT) format is used. Most often used for sending the report to another user via e-mail.



PrinterSelect displays the Printer Selection common dialog box which enables the user to specify a different printer.
Syntax : [form.]Report.PrinterSelect
For example:
CrystalReport1.PrinterSelect
«When the user prints, a dialog box appears for selecting the desired printed for printing the report.»
Remarks
This method allows you to pick the printer used for printing the report.
This method is intended primarily for printing reports to a printer. However, changes made to the Print Setup dialog box may also affect how reports appear in preview windows and when exported.



Connect specifies the information required to log on to an SQL server or an ODBC data source.
Syntax : [form.]Report.Connect[= DataSourceName;UserID;Password;DatabaseQualifier$]
For example:
CrystalReport1.Connect = “DSN = Accounting;UID = 734;PWD = bigboard;DSQ= Administration”
«Connects to the “Administration” database on the “Accounting” server using the user ID #734 and the password “bigboard”.»

CrystalReport1.Connect = “dsn=; uid=; pwd=bigboard; dsq=“
«Connects to a password-protected Paradox database. All that is being passed is the password “bigboard”.»
Remarks
Use the Connect property when the report connects to only a single ODBC data source or SQL server, and only a single set of log on information is required. If the report connects to multiple data sources that require different log on information, use “LogOnInfo”.
Enter the parameters necessary to log on to the SQL server that you need to be activated for your report. Parameters should be in the following format:
DSN = name;UID = userID;PWD = password;DSQ = database qualifier

name is the server name or ODBC data source name,
userID is the name you have been assigned for logging on to the SQL server,
password is the password you have been assigned for logging on to the SQL server,
and database qualifier is the database name if your server uses the database concept.

The database qualifier parameter, DSQ, is required only when it is applicable to the ODBC/SQL driver you are using. If your DBMS does not use the database concept, you do not need to specify the DSQ parameter.
Before you can use this property for an ODBC/SQL database, you must install the ODBC/SQL driver for whatever SQL database you are planning to use, and put the Database/BIN location in your path.
If you are connecting to an SQL or other password protected database directly,without going through ODBC, use the name of the SQL server for the DSN parameter.