Toon posts:

[VB] SQL Stringwijziging werkt niet?

Pagina: 1
Acties:

Verwijderd

Topicstarter
Ik heb een recordset in VB6 gedefinieerd met als naam rsOrderSpecs. De bijbehorende SQLstring is origineel (met code):

comOrderSpecs.ActiveConnection = cnnRodaBike
comOrderSpecs.CommandText = "SELECT * FROM Orders_specificaties ORDER BY Ordernr"

Ik wil hem op een gegeven moment wijzigen:

code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
Private Sub cmbOrdernr_Click()

Dim i As Integer
Dim SQLSt As String

    SQLSt = "SELECT * FROM Orders_specificaties WHERE Ordernr = " & "'" & cmbOrdernr.Text & "'"
    comOrderSpecs.CommandText = SQLSt
    Set rsOrderSpecs = comOrderSpecs.Execute
    
    Set DataGrid1.DataSource = rsOrderSpecs
    
  |
  |
  |Nog wat regels...
  |
  |

End Sub


Helaas flipt VB op het laatste stukje, te weten:
Set DataGrid1.DataSource = rsOrderSpecs

Ik krijg de foutmelding:
Runtime-error '7004':
The rowset is nog bookmarkable


Iemand die mij kan helpen? :(

Verwijderd

Topicstarter
<up> :)

Verwijderd

Complex-bound controls require that the recordset be bound to support navigation and bookmarks. This functionality is required for the control to read the data in the recordset and know that it can later find that particular row. You may receive an error if you try to bind a complex-bound control to a data source whose data does not support this functionality.

[...]

Run the code and you should see an error message that says "The rowset is not bookmarkable."
Ik denk dat er een probleempje is met de DB driver die je gebruikt.