Hi,
ich verstehs nicht mehr ... ich will einen Recordset erzeugen aus einer datenbank
doch komischerweise führt die SQL Abfrage zu RecordCount=0 aber im Datenbank Designer von VB6 bekomm ich einen Recordset wenn ich den gleiche SQL String ausführe ...
der übergebene String sieht so aus:
ich verstehs nicht mehr ... ich will einen Recordset erzeugen aus einer datenbank
doch komischerweise führt die SQL Abfrage zu RecordCount=0 aber im Datenbank Designer von VB6 bekomm ich einen Recordset wenn ich den gleiche SQL String ausführe ...
der übergebene String sieht so aus:
Visual Basic-Quellcode
- private con2 as ADODB.Connection
- ' ADODB-Recordset erstellen
- Public Function dbRecordset_Planung(ByVal sSQL As String) As ADODB.Recordset
- Dim conString As String
- Dim CursorType As ADODB.CursorTypeEnum
- Dim LockType As ADODB.LockTypeEnum
- Dim CursorLocation As ADODB.CursorLocationEnum
- CursorType = adOpenDynamic
- LockType = adLockOptimistic
- CursorLocation = adUseClient
- conString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & args(5) & ";Mode=Read;Persist Security Info=False;"
- Set con2 = New ADODB.Connection
- con2.ConnectionString = conString
- con2.Open
- Set dbRecordset_Planung = New ADODB.Recordset
- With dbRecordset_Planung
- .CursorLocation = CursorLocation
- .Open sSQL, con2, CursorType, LockType
- End With
- End Function
Dieser Beitrag wurde bereits 1 mal editiert, zuletzt von „_PASCAL_“ ()