Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to insert SQL statment to this ?
Message
Information générale
Forum:
Visual Basic
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00402113
Message ID:
00404396
Vues:
17
>Hi,
>how I can insert this SQL statment :
>" SELECT * FROM unit, unittype, estate WHERE untestateidno = estateid AND unttypeidno = unittypeid"
>
>TO this RecordSet :
>
>With rstUnit
> .Index = "PrimaryKey"
> .Open "unit", myConn, adOpenKeyset, adLockPessimistic, adCmdTableDirect
>End With
>
>Many thanks
>adsc


Instead of giving a table name, give your SQL query and use the ORDER BY clause instead of using an index like this :
With rstUnit
   .Open "SELECT * FROM unit, unittype, estate WHERE untestateidno = estateid AND unttypeidno = unittypeid ORDER BY FieldName", myConn, adOpenKeyset, adLockPessimistic
End With
Éric Moreau, MCPD, Visual Developer - Visual Basic MVP
Conseiller Principal / Senior Consultant
Moer inc.
http://www.emoreau.com
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform