Skip to Content
author's profile photo Former Member
Former Member

"This field name is not known", VB6, CRXI RDC

Implementing RDC/designer in VB6 code.

The underlying DB is SQL SERVER 2005. I turned to the RDC / designer method because I couldn't figure out, in a way that worked, how to override the SQL Server db at run time on client machine. My reports continued to want to find the tables on my development platform, not the live data in production. I've been fighting this thing for 6 weeks. (Never had the problem with Access mdb's, but that's a moot point)

Any help / advice is appreciated!!

All is well with my reports containing 1 table, using the following code:

module

Public KReport As New CrystalReport2

command button

Set KReport = New CrystalReport2

KReport.DiscardSavedData ' (may not be necessary, the report does not have saved data)

KReport.Database.AddOLEDBSource Adodc1.ConnectionString, "Netlink_ProductMaster"

KReport.Database.SetDataSource Adodc1.Recordset, 3, 1

Load Form2

Form2.CRViewer1.ReportSource = KReport

Form2.CRViewer1.ViewReport

Form2.Show

However, in my report with multiple tables I get error "This field name is not known" but no indication as to which field is a problem. Here's my code: (Note - If I bypass the SetDataSource code the report displays fine. That won't work at user site)

module

Public LReport As New CrystalReport3

command button

Dim i%

Dim result&

Set LReport = New CrystalReport3

LReport.DiscardSavedData

For i% = 1 To LReport.Database.Tables.Count

LReport.Database.AddOLEDBSource Adodc1.ConnectionString, LReport.Database.Tables(i%).Name

LReport.Database.SetDataSource Adodc1.Recordset, 3, i%

' LReport.Database.Tables(i%).CheckDifferences result&

' LReport.ReadRecords ' This just moved the error to here rather than when Form2 was "shown"

Next i%

Load Form2

Form2.CRViewer1.ReportSource = LReport

Form2.CRViewer1.ViewReport

Form2.Show

Add a comment
10|10000 characters needed characters exceeded

Related questions

2 Answers

  • Best Answer
    Posted on Jul 16, 2009 at 07:06 PM

    Are the data structures identical?

    Did you try Database, Verify Database... (in Crystal Designer for that report)?

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jul 20, 2009 at 07:34 PM

    same as the other post - locking this one.

    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.