Results 1 to 2 of 2
  1. #1
    Join Date
    Feb 2004
    El Salvador

    Unanswered: Visual Basic + DataReport

    I'm trying to make a report where you see general information of a range of products. I have a stored procedure in sql server 2000 that has two parameters. I also have a DataEnvironment with a command that calls the stored procedure. I see both parameters in the property window of the command. My question is, how do I pass the text value of a combox to the value of each parameter?

    My DataEnvironment is named DataEnvironment1, the Command is named Command1 and my parameters are named item1 and item2. The comboxes are named CmbCodigo1 and CmbCodigo2. And I have tried this:

    DataEnvironment1.Commands(0).Parameters(0).Value = CmbCodigo1.text
    DataEnvironment1.Commands(0).Parameters(1).Value = CmbCodigo2.text
    Last edited by diegocro; 09-08-04 at 14:38.

  2. #2
    Join Date
    Mar 2004
    Here is the method to call a stored-procedure with parameters:

    set cm.CommandText = "add_school"
    cm.cmdCommandType = adCmdStoredProc
    set p = cm.Parameters
    p.Append cm.CreateParameter("@style",adChar,adParamInput,50)
    p.Append cm.CreateParameter("@school", adChar, adParamInput,50)
    p.Append cm.CreateParameter("@id",adInteger,adParamInput)
    cm("@style") = "Kempo"
    cm("@school") = "WSU"
    cm(Id) = 1

    Download for FREE the ADO/DAO Data Controls that makes life EASIER developing database applications in: VB, FoxPro, Access, VC++, .NET etc... Navigate, Add New, Delete, Update, Search, Undo and Save your changes. Supports Disconnected Recordsets and Transactions!

    Or try our Ask An Expert service to answer any of your questions!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts