General information
Category:
Database DAO/RDO/ODBC/ADO
Hi,
Anybody can help me!!
I have query but looks like hang in my application when i used NextRecordSet of ADO. My code is include here....
cmd.CommandTimeout = 5
cmd.CommandType = adCmdStoredProc
cmd.CommandText = "SP_SalLedAuditTrail"
Set prmFrom = cmd.CreateParameter("dFrom", adDate, adParamInput)
prmFrom.Value = Format(DTPicker1.Value, "mm/dd/yyyy")
cmd.Parameters.Append prmFrom
Set prmTo = cmd.CreateParameter("dTo", adDate, adParamInput)
prmTo.Value = Format(DTPicker2.Value, "mm/dd/yyyy")
cmd.Parameters.Append prmTo
Set RS = cmd.Execute
If Not RS.EOF Then
Dim rptApp As CRAXDRT.Application
Dim rptReport As CRAXDRT.Report
Set rptApp = New CRAXDRT.Application
Set rptReport = rptApp.OpenReport("c:\source\rpt\SOSSalLedAudTrail.rpt")
rptReport.Database.SetDataSource RS, 3, 1
frmRpt.CRViewer1.ReportSource = rptReport
frmRpt.CRViewer1.ViewReport
frmRpt.Show vbModal
Else
MsgBox "No record to be printed....", vbInformation + vbOKOnly, "Empty Record"
End If
NOTE:
When i execute in Query Analyser they have records...
TIA
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only