cancel
Showing results for 
Search instead for 
Did you mean: 

i want get date from tabel using visualbasic 6 &crystal report 4.6 & by dao connection

former_member914052
Discoverer
0 Kudos

but i cant success my filter data

Dim sql, b As String

sql = 8

b = "Ê"

CrystalReport1.ReportFileName = App.Path & "\report51.rpt"

CrystalReport1.SelectionFormula = ""

CrystalReport1.SelectionFormula = "{customer.code}= " & "" & sql & ""

CrystalReport1.SelectionFormula = "{customer.name}= " & "'" & b & "'"

CrystalReport1.Action = 1

i cant get answer

please help me

Accepted Solutions (0)

Answers (3)

Answers (3)

former_member292966
Active Contributor
0 Kudos

Hi Ahmed,

When you build the Selection Formula, you're overwriting the previous entry. So your formula is only going to be:

{customer.name} = 'Ê'

You need to append each line to the formula like:

Dim sql, b, c As String
sql = 8
b = "Ê"
CrystalReport1.ReportFileName = App.Path & "\report51.rpt"
c = ""
c = "{customer.code}= " & "" & sql & ""
c = c & " And {customer.name}= " & "'" & b & "'"
CrystalReport1.SelectionFormula = c 
CrystalReport1.Action = 1

The formula you create should look the same as the formula you create in Crystal. Capture the string and paste it directly into Crystal to test it. If it doesn't work in Crystal it won't work from your code.

Good luck,

Brian

former_member914052
Discoverer
0 Kudos

thnaks ..

but i want at vb6 not vb.net

are you can help

??

0 Kudos

Wow, 4.6 was released in 1997.

Are you still using Windows 95 also?

DAO has been ended a long time ago, try using ODBC and it should work.

If you upgrade to Visual Studio 2008 you can get CR 10.5 or VS 2010 -> VS 2017 you can get the CR runtime here:

https://wiki.scn.sap.com/wiki/display/BOBJ/Crystal+Reports%2C+Developer+for+Visual+Studio+Downloads

Don