Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Passing Parameters to Access View
Message
De
11/07/2003 23:28:51
 
 
À
11/07/2003 06:34:44
Rene Lovino
Bigfoot Global Solutions, Inc
Cebu, Philippines
Information générale
Forum:
Visual Basic
Catégorie:
Bases de données DAO/RDO/ODBC/ADO
Divers
Thread ID:
00809104
Message ID:
00809521
Vues:
41
Hi Rene,

The code works fine..

What about if I have more than one parameter? How do I handle these..

Here is the code I use using two parameters
  Dim objCon As ADODB.Connection
  Dim objCmd As ADODB.Command
  Dim objRst As ADODB.Recordset
  Dim objPar As ADODB.Parameter
  Dim ConnectionString as String

  ConnectionString = "Your connecntion, user, password, etc."
  Set objCon = New ADODB.Connection
  Set objCmd = New ADODB.Command

  objCon.Open ConnectionString
  objCmd.ActiveConnection = objCon
  objCmd.CommandText = "qrySALES"
  objCmd.CommandType = adCmdStoredProc
  Set objPar = objCmd.CreateParameter("DATE", adDBDate, adParamInput, 12, txtDateFrom)
  objCmd.Parameters.Append objPar
  Set objPar = objCmd.CreateParameter("DATE", adDBDate, adParamInput, 12, txtDateTo)
  objCmd.Parameters.Append objPar

  Set objRst = objCmd.Execute
But I could'nt get the exact result.

What am I doing wrong in the code?

Thanks in advance.

Noel
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform