cancel
Showing results for 
Search instead for 
Did you mean: 

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

Former Member
0 Kudos

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

Accepted Solutions (1)

Accepted Solutions (1)

ido_millet
Active Contributor
0 Kudos

Are the data structures identical?

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

Answers (1)

Answers (1)

0 Kudos

same as the other post - locking this one.