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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Connecting to DB with CR9

Status
Not open for further replies.

kimtp

Programmer
Jun 15, 2002
310
US
Have just started using CR9 with VB6 and am having some connection problems. I have tried connecting using both of these methods:

crxDatabaseTable.ConnectionProperties.Item("Database Name") = App.Path & "\Database.mdb"

When using this method I get the "Invalid Data Source" msg and "Method 'Database' of Object 'IReport' Failed".

Also, when using recordset method:

Dim crxRpt As New CRAXDRT.Report
sSql = "SELECT [Lastname] & ', ' & [Firstname] AS Name, Members.ClassYear," & _
" Attending.NumAttend, Attending.Deceased, Attending.MealAmount," & _
" Attending.SouvenirNum, Attending.SouvenirAmount," & _
" Attending.GiftAmount, Attending.Attending," & _
" [MealAmount]+[SouvenirAmount]+[GiftAmount] AS Totals" & _
" FROM Members INNER JOIN Attending ON Members.ID = Attending.ID" & _
" Where (((Attending.Deceased) = False) And " & _
" (([MealAmount] + [SouvenirAmount] + [GiftAmount]) = True))" & _
" ORDER BY Members.LastName"
If rsMembers.State = adStateOpen Then
rsMembers.Close
End If
rsMembers.Open sSql, cData
crxRpt.Database.SetDataSource rsMembers, 1

I get the same error messages.

Any help is greatly appreciated.

Thanx.

Kim
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top