I have created a Cryatal Report and set its Access database(.mdb) during design time. I have imported the crystal report into VB.NET. now i want to know how can we set the database path during runtime. The database to which i've linked will change its path and name every year.

Kindly hepl me out

I have created a Cryatal Report and set its Access database(.mdb) during design time. I have imported the crystal report into VB.NET. now i want to know how can we set the database path during runtime. The database to which i've linked will change its path and name every year.

Kindly hepl me out

hope it will help you :


Dim path1 As String = "your connection here" '" '' path
'' for normal ADO Concept
'' The current DataSource is an ADO

'' change path of the database
rpt.DataSourceConnections.Item(0). _
SetConnection("", "" & path1 & "", False)
'' if password is given then give the password
'' if not give it will ask at runtime
rpt.DataSourceConnections.Item(0).SetLogon("Admin", "")