Hallo Erich,
das läuft auch über ADO. Hat den Vorteil das du jederzeit
eine andere Datenquelle z.B. Access oder Oracle oder ...
einbinden kannst. Da brauchts du nur den ConnectionString
wechseln.
Hier ein Beispiel:
.....
Dim adoCon As ADODB.Connection
Dim adoRs As ADODB.Recordset
Private Sub Form_Load()
Dim conStr As String
Dim field As ADODB.field
Set adoCon = New ADODB.Connection
conStr = "Provider=MSDASQL.1;Persist Security Info=False;Data Source=dBASE-Dateien;Initial Catalog=e:\leg"
adoCon.CursorLocation = adUseClient
adoCon.ConnectionString = conStr
adoCon.Open
Set adoRs = New ADODB.Recordset
adoRs.Source = "analytik"
adoRs.ActiveConnection = adoCon.ConnectionString
adoRs.CursorType = adOpenDynamic
adoRs.CursorLocation = adUseClient
adoRs.Open
For Each field In adoRs.Fields
Debug.Print field.Name
Next field
If adoRs.RecordCount > 0 Then
adoRs.MoveFirst
While Not adoRs.EOF
Debug.Print adoRs(0).Value
Debug.Print adoRs(1).Value
adoRs.MoveNext
Wend
End If
End Sub
....
Unter Verweisen muß "Microsoft ActiveX Data Objects 2.x .." angegeben
werden. Ich habe die Version 2.8.
Wenn die nicht vorhanden ist, gibts die im Internet bei MicroZoff.
MDACTYP.EXE oder so.
Viel erfolg
Stelli1
Eine Antwort auf diesen Beitrag verfassen (mit Zitat/Zitat des Beitrags) IP