Skip to Content

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

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

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • Jan 04 at 10:54 PM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • Jan 05 at 07:46 PM

    thnaks ..

    but i want at vb6 not vb.net

    are you can help

    ??

    Add comment
    10|10000 characters needed characters exceeded

  • Jan 07 at 10:19 PM

    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

    Add comment
    10|10000 characters needed characters exceeded