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 a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • Posted on Jan 04, 2019 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 a comment
    10|10000 characters needed characters exceeded

  • Posted on Jan 05, 2019 at 07:46 PM

    thnaks ..

    but i want at vb6 not vb.net

    are you can help

    ??

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jan 07, 2019 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 a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.