cursor1=sql1.ExecQuery("select name,pos,directory,jpeg,html,web_code,reversible,inverser,bottom,box_left,box_top,height,left,right,top,widht from cartes order by pos")
If cursor1.RowCount>0 Then
liste_cartes.Clear
For a =0 To cursor1.RowCount-1
cursor1.Position=a
Dim carte As type_carte
carte.Initialize
carte.nom=cursor1.GetString("name")
carte.pos=cursor1.GetLong("pos")
carte.directory=renamefile_forread(cursor1.GetString("directory"))
carte.jpeg=renamefile_forread(cursor1.GetString("jpeg"))
carte.html=renamefile_forread(cursor1.GetString("html"))
carte.web_code=cursor1.GetString("web_code")
carte.reversible=readboolean(cursor1.GetInt("reversible"))
carte.inverser=readboolean(cursor1.Getint("inverser"))
carte.bottom=cursor1.Getint("bottom")
carte.box_left=cursor1.Getint("box_left")
carte.box_top=cursor1.Getint("box_top")
carte.height=cursor1.Getint("height")
carte.left=cursor1.Getint("left")
carte.right=cursor1.Getint("right")
carte.top=cursor1.Getint("top")
carte.widht=cursor1.Getint("widht")
'carte.image=Loadbitmapfromblob(cursor1.getBlob("image"))
'carte.image=Main.icon
liste_cartes.add(carte)
Next
cursor1.close
For a =0 To liste_cartes.Size-1
'Msgbox(a,Main.Titre)
Dim carte As type_carte=liste_cartes.Get(a)
cursor1=sql1.ExecQuery("select * from cartes where pos="&carte.pos&" order by pos")
If cursor1.RowCount=1 Then
cursor1.Position=0
carte.image=Loadbitmapfromblob(cursor1.getBlob("image"))
liste_cartes.Set(a,carte)
Else
Return onerrordatabase("Il y a plus qu'une carte avec la position "&a)
End If
Next
cursor1.close