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!

help urgently

Status
Not open for further replies.

elanchezhiyan

Programmer
Mar 6, 2002
4
IN
By using Rdc in crystalreport8.0 .
please give me some idea to create report at runtime by using ado.
 
Here is the code that will bind the sql during run time in VB


Dim rs As New ADODB.Recordset
Dim crReport1 As New crUnboundReport 'bind your own RDC
Dim cnn1 As New ADODB.Connection
Dim strCnn As String


sSQL = "Select * From Table1" 'put your own SQL statement

Set cnn1 = New ADODB.Connection
strCnn = "Driver={SQLserver};Server=lra_sql;Database=CDMS_Project" 'put your own connection string

cnn1.Open strCnn

rs.Open sSQL, cnn1

crReport1.Database.AddADOCommand cnn1, rs.ActiveCommand

frmPreview.CRViewer1.ReportSource = crReport1 'bind your own CRViewer
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top