Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

DataReport Fehlermeldung: DataField nicht gefunden ?????

1 view
Skip to first unread message

Sabine

unread,
Mar 17, 2005, 4:36:52 AM3/17/05
to
Hallo,
ich hab folgendes Problem. Ich will ein DataReport erstellen und hab
dazu folgendes Code programmiert:

Private Sub Command1_Click()
Dim adoCN As ADODB.Connection
Dim adoRS As ADODB.Recordset
Dim strCN As String

Set adoCN = New ADODB.Connection
strCN = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Dokumente und
Einstellungen\petschl\DA\DRG-Hilfe\drg_versuch_31012005.mdb"
adoCN.ConnectionString = strCN
adoCN.Open

Set adoRS = adoCN.Execute("SELECT hd_tab.hd_code, hd_tab.hd_text,
therapie_tab.therapie_code, therapie_tab.therapie_text " + _
"FROM therapie_tab INNER JOIN (hd_tab INNER
JOIN hd_therapie_tab ON hd_tab.hd_id = hd_therapie_tab.hd_id) " + _
"ON therapie_tab.therapie_id =
hd_therapie_tab.therapie_id")

Debug.Print adoRS(0) & " " & adoRS(1) & " " & adoRS(2) & " " &
adoRS(3)
With DataReport1
.DataMember = vbNullString
'.Orientation = rptOrientPortrait
Set .DataSource = adoRS

'Detail:
With .Sections("Bereich1").Controls
.Item("txttherapie_code").DataField =
adoRS.Fields("therapie_code")
.Item("txttherapie_text").DataField =
adoRS.Fields("therapie_text")
End With

'Header
With .Sections("Bereich6").Controls
.Item("txthd_code").DataField = adoRS.Fields("hd_code")
.Item("txthd_text").DataField = adoRS.Fields("hd_text")
End With

.Show vbModal, Me
End With



' Bild laden


' Verbindung zur DB schließen
adoRS.Close
Set adoRS = Nothing
adoCN.Close
Set adoCN = Nothing
End Sub


Leider kommt immer folgende Fehlermeldung:
DataFiel '.....' nicht gefunden

Was mach ich nur falsch??

Gruss

0 new messages