Hi,
I'm developing a database application in Visual Basic 6 and there are some occaisions where I need to execute two different queries on different tables. When I try and close the recordset I'm using to do the first query for the second query, I get an error saying that the recordset is already closed, despite the fact that I have just opened it.
VB Code:
Private Sub DoUpdate(ByVal objConn as ADODB.Connection, _ ByVal strSurname as String, ByVal strNew as String, _ ByVal intID as Integer) Dim objRS as ADODB.Recordset Set objRS = New ADODB.Recordset objRS.Open "INSERT INTO Members(Surname) VALUES('" & strSurname & "');", _ objConn, adOpenStatic, adLockPessimistic objRS.Close objRS.Open "UPDATE Register SET NewUser='" & strNew & _ "' WHERE MemID=" & intID & ";", objConn, adOpenStatic, adLockPessimistic objRS.Close End Sub
Any ideas?




Reply With Quote