Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to pass parameter query???
Message
 
À
10/12/1999 03:58:32
Information générale
Forum:
Visual Basic
Catégorie:
Autre
Divers
Thread ID:
00301567
Message ID:
00301610
Vues:
25
>I'm trying to create a report using VB6's data report. I have already created a dataenvironment, a connection, and a command. My command is set to a SQL query like:
>
>Select * from emp_mast where salary >= ?
>
>At the command's parameter tab the parameter panel contains: Param1.
>
>The problem is I do not know how to pass a value to this command programmatically. Can anyone show me some code on how to do this?
>
>Thanks in advance!
>
>Ramon carlos


Hi Ramon,

This is a piece of code to get data programmatically:
Dim strQuery as String
Dim strCriteria as String

strCriteria = "Whatever"

strQuery = "Select A.ID FROM Contacts A Where A.ID = '" & Trim(strCriteria)& "';"

Set db = CurrentDb()
Set rstContacts = db.OpenRecordset(strQuery, dbOpenSnapshot)

... your code goes here ...
HTH, Igor
Igor Gelin
Database Developer
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform