Based this piece of code to SELECT is required to open a table mytable ?????
Se tRS = New ADODB.Recordset
RS .Open "mytable ",CONN, adOpenKeyset, adLockPessimistic, adCmdTable
strSQL = "SELECT * FROM mytable WHERE RAPPORTO = '" & RAPPORTO & "'"
Set RS = GAF_CONN.Execute(strSQL)
If No tRS .EOF Then
...ecccc
end if
clear me please
-
- Administrator
- Posts: 78535
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
-
- PlatinumLounger
- Posts: 4362
- Joined: 26 Apr 2010, 17:36
Re: clear me please
In effect before to use this piece of code:HansV wrote:What exactly do you want to do?
Code: Select all
strSQL = "SELECT * FROM mytable WHERE RAPPORTO = '" & RAPPORTO & "'"
Set RS = GAF_CONN.Execute(strSQL)
Code: Select all
Se tRS = New ADODB.Recordset
RS .Open "mytable ",CONN, adOpenKeyset, adLockPessimistic, adCmdTable
-
- Administrator
- Posts: 78535
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: clear me please
You don't need to open the table first. You can either use
or
(But not both - choose only one)
Code: Select all
Dim RS As ADODB.Recordset
strSQL = "SELECT * FROM mytable WHERE RAPPORTO = '" & RAPPORTO & "'"
Set RS = GAF_CONN.Execute(strSQL)
Code: Select all
Dim RS As New ADODB.Recordset
strSQL = "SELECT * FROM mytable WHERE RAPPORTO = '" & RAPPORTO & "'"
RS.Open strSQL, GAF_CONN, adOpenKeyset, adLockPessimistic, adCmdText
Best wishes,
Hans
Hans
-
- PlatinumLounger
- Posts: 4362
- Joined: 26 Apr 2010, 17:36
Re: clear me please
OK! Tks, as usual.