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

How can filter the field in crystal report at run time in vb.net

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", "")

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.