Welcome to Dream.In.Code
Become a VB Expert!

Join 150,151 VB Programmers for FREE! Get instant access to thousands of VB experts, tutorials, code snippets, and more! There are 2,363 people online right now. Registration is fast and FREE... Join Now!




join with cr9 in vb6

 
Reply to this topicStart new topic

join with cr9 in vb6

shruti23
10 Jul, 2008 - 11:44 PM
Post #1

New D.I.C Head
*

Joined: 10 Jul, 2008
Posts: 1

Hello sirs,

i want to run join query in Crystal report 9 in vb6.
it gives error as not supported
Details:DAO error code:0xbf5
Source:DAO.Database
Description:too few parameters, expected 6
below is my code:-

vb
rs.Open "SELECT S.Scope, S.RF, S.RevisionNo, P.[Date], P.Scope, P.ItemName, P.ItemCode, P.QtyInStock, P.QtyOrdered, " & _
"P.Remark FROM ScopeMaster S, ProductItem P " & _
"WHERE S.Scope=P.Scope AND P.Scope = '" & frmPurchaseReport.cmbScope.Text & "'" & _
"AND P.Date = #" & frmPurchaseReport.dtpRDate.Value & "#", cn, adOpenDynamic, adLockOptimistic, adCmdText
For i = 1 To Report.Database.Tables.Count
Report.Database.Tables(i).SetDataSource (App.Path & "\DB\WinStock.mdb")
Report.Database.Tables(i).Location = App.Path & "\DB\WinStock.mdb"
Report.Database.Tables(i).SetLogOnInfo "", App.Path & "\DB\WinStock.mdb", "Admin", "becool"
Next i
Report.SQLQueryString = "SELECT S.Scope, S.RF, S.RevisionNo, P.[Date], P.Scope, P.ItemName, P.ItemCode, P.QtyInStock, P.QtyOrdered,P.Remark FROM ScopeMaster S, ProductItem P WHERE S.Scope=P.Scope AND P.Scope= '" & frmPurchaseReport.cmbScope.Text & "' AND P.Date = #" & frmPurchaseReport.dtpRDate.Value & "#" ', cn, adOpenDynamic, adLockOptimistic, adCmdText

Report.Database.SetDataSource rs
CRViewer91.ReportSource = Report
CRViewer91.ViewReport

pls help me

Mod edit: Please code.gif
Thanks, gabehabe smile.gif
User is offlineProfile CardPM
+Quote Post

tody4me
RE: Join With Cr9 In Vb6
11 Jul, 2008 - 06:16 AM
Post #2

Only Jenny Craig makes thin clients...
Group Icon

Joined: 12 Apr, 2006
Posts: 1,349



Thanked: 5 times
Dream Kudos: 100
My Contributions
Try changing the rs data type to ADODB. It sounds like you're using the DAO object instead, and being out of date, the report can't generate. The options for ADODB are 5, and it looks like what you're trying to use.

This post has been edited by tody4me: 11 Jul, 2008 - 06:19 AM
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 1/9/09 02:34AM

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter

Live VB Help!

VB Tutorials

Reference Sheets

VB Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month