tags:

views:

310

answers:

1

How to set a crystal report datafile location in VB

CODE:

CR.DataFiles(0) = " & databasetext.Text & "
CR.ReportFileName = App.Path & "\rpt_attendancereport.rpt"

" & databasetext.Text & " - am selecting the database location

But it showing error "Unable to open database"

and also i checked in crystal report ->> Database ->> Set Location ->> showing different location, is not showing my selected location

If am selecting a location it will appear in crystal report set location. How to make a code.

Need Help.

A: 

I guess databasetext is a text field containing the path to the database? If that's the case your code is wrong. Try this:

CR.DataFiles(0) = databasetext.Text
DR