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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using VB 6.0 with Access 2k Database & Crystal Reports 8

Status
Not open for further replies.

yjoke

Programmer
Feb 14, 2002
26
PT
What is the correct syntax to connect Crystal Reports through Visual Basic 6 to an Access 2000 database, in order to show the specified fields?

When i need to connect to an SQL 2000 database i use the following code:

Report.Database.LogOnServer "p2ssql.dll", "ServerName", "DatabaseName", "username", "password"
form.CrystalViewer.ReportSource = Report
form.CrystalViewer.ViewReport

this is a dead serious urgent matter. i'm facing a project deadline and need this really badly.

Any help would be apreciated...
Thankx in advance!!!
 
Generally I like to use TTX files and create DSR files from Crystal report files

Follow these steps:
1) Create the ADO recordset that will be used in the report as it is created in VB

2) Create a TTX file (this is an ASCII text definition similar to the ADO recordset - it is comma delimited and describes the Name and DataType on each line of the file)

3) Create the Crystal Report in Crystal Reports (when specifiying the database to use, use Other Active Database sources and browse for the Definition file you created in step 2

4) In VB, add a Crystal Report object (DSR file) and create it from the Crystal Report file (RPT) that you created in step 3 - name the object (e.g. crdReport1)

5) In VB, create a variable based on the report object and set the datasource to the ADO recordset that was created in step 1 and then show the report object

Good luck!
TMurph
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top