|
-
Jan 23rd, 2006, 09:39 AM
#1
Thread Starter
New Member
code help (RobDog888)
I copied your preview Crystal Report code and I can't get it to work. Here is what I have...can you please tell me what I'm missing????
<VB Code>
Private Sub Command1_Click()
Dim oApp As CRAXDRT.Application
Dim oReport As CRAXDRT.report
Dim oRs As ADODB.Recordset
Dim sSQL As String
Dim db As Database
Set db = CurrentDb
sSQL = "SELECT * FROM Posted_Trans_Weekly"
Set oRs = New ADODB.Recordset
Set oRs = oCnn.Execute(sSQL)
Set oApp = New CRAXDRT.Application
Set oReport = oApp.OpenReport("c\test.rpt", 1)
oReport.Database.SetDataSource oRs, 3, 1
crvMyCRViewer.ReportSource = oReport
crvMyCRViewer.ViewReport
End Sub
<\VB code>
I'm getting an error message on the line oCnn.Execute (sSQL). Error message is "Compile error. Variable not defined."
Last edited by kchisley; Jan 23rd, 2006 at 10:36 AM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|