Montrer resultat sql

chris-chumillas

New member
Local time
Today, 02:01
Joined
Nov 23, 2006
Messages
5
Je voudre voire le resultat de ma sequence sql. COde:


Private Sub Commande11_Click()

Dim BDD As Database 'Objeto para manejar la base de datos
Dim TBL As dao.Recordset 'Objeto para manejar la Tabla
Dim SQL As String

Set BDD = OpenDatabase("d:\fia\fia.ch.mdb") 'Abre la base de datos
SQL = "SELECT * FROM vehiculo "
Set TBL = BDD.OpenRecordset(SQL) tabla

txt_sql.Value = TBL.OpenRecordset ' ICI! JE VE VOIRE LE RESULTAT

TBL.Close
BDD.Close
end sub

Je troube ça trot kon. Pourqua montre pas mon resultat? Merci
 
Peut-être c'est en raison du point-virgule ayant été omis ?

SQL = "SELECT * FROM vehiculo;"
 
No. ";" is not necessary. I'm work with Access XP or 2002. I don't understand to do for to view the result of the sql sentences. It is a simple sentence and a simple object (TextBox).

Please helpme
 
Set TBL = BDD.OpenRecordset("vehiculo") 'you do not need the select statement

'once you have done this the table is open!
tbl.movefirst
msgbox(tbl!recordid)
tbl.edit
tbl!fieldname = newvalue
tbl.update
tbl.close

set tbl = nothing
bdd.close
set bdd = nothing

end sub


'i am not quite sure about referring to the external database, but the rest is ok

refer to recordsets by

rst. method
or
rst! fieldname
 

Users who are viewing this thread

Back
Top Bottom