Need help with ADO Command.Parameters (Cont) 
Author Message
 Need help with ADO Command.Parameters (Cont)

I tried by checking:
Debug.Print MyCommand.CommandText
and after setting the parameter, I see the same query with '?' sign.
So no parameter setting happened.
Boaz



Sat, 07 May 2005 23:20:25 GMT  
 Need help with ADO Command.Parameters (Cont)

Hi,

No, commandtext will be the same. You should check if you have any result in recordset after executing of your command. Something like

If MyRecordset.EOF then
'no result
else
'there is a result
endif

--
Val Mazur
Microsoft MVP


  I tried by checking:
  Debug.Print MyCommand.CommandText
  and after setting the parameter, I see the same query with '?' sign.
  So no parameter setting happened.
  Boaz



Sat, 07 May 2005 23:23:05 GMT  
 Need help with ADO Command.Parameters (Cont)

Since I'm working also on IBM DB2,
Is there a way to see the SQL statement?
I get [IBM][CLI Driver] CLI0112E  Error in assignment. SQLSTATE=22005"
Boaz

  Hi,

  No, commandtext will be the same. You should check if you have any result in recordset after executing of your command. Something like

  If MyRecordset.EOF then
  'no result
  else
  'there is a result
  endif

  --
  Val Mazur
  Microsoft MVP


    I tried by checking:
    Debug.Print MyCommand.CommandText
    and after setting the parameter, I see the same query with '?' sign.
    So no parameter setting happened.
    Boaz



Sat, 07 May 2005 23:36:39 GMT  
 Need help with ADO Command.Parameters (Cont)

But you build it yourself and you should know what it looks like. Try to do simle test. Do not use any Variant variables and assign value to your parameter using just simple code like

MyParameter.Value="TestValue"

--
Val Mazur
Microsoft MVP


  Since I'm working also on IBM DB2,
  Is there a way to see the SQL statement?
  I get [IBM][CLI Driver] CLI0112E  Error in assignment. SQLSTATE=22005"
  Boaz

    Hi,

    No, commandtext will be the same. You should check if you have any result in recordset after executing of your command. Something like

    If MyRecordset.EOF then
    'no result
    else
    'there is a result
    endif

    --
    Val Mazur
    Microsoft MVP


      I tried by checking:
      Debug.Print MyCommand.CommandText
      and after setting the parameter, I see the same query with '?' sign.
      So no parameter setting happened.
      Boaz



Sat, 07 May 2005 23:52:39 GMT  
 Need help with ADO Command.Parameters (Cont)

You are right but I have 30 parameters, If i can see the Statement its much easier,..

  But you build it yourself and you should know what it looks like. Try to do simle test. Do not use any Variant variables and assign value to your parameter using just simple code like

  MyParameter.Value="TestValue"

  --
  Val Mazur
  Microsoft MVP


    Since I'm working also on IBM DB2,
    Is there a way to see the SQL statement?
    I get [IBM][CLI Driver] CLI0112E  Error in assignment. SQLSTATE=22005"
    Boaz

      Hi,

      No, commandtext will be the same. You should check if you have any result in recordset after executing of your command. Something like

      If MyRecordset.EOF then
      'no result
      else
      'there is a result
      endif

      --
      Val Mazur
      Microsoft MVP


        I tried by checking:
        Debug.Print MyCommand.CommandText
        and after setting the parameter, I see the same query with '?' sign.
        So no parameter setting happened.
        Boaz



Sun, 08 May 2005 00:03:07 GMT  
 Need help with ADO Command.Parameters (Cont)

Hi,

Maybe DB2 has some tracing tools, but I am not sure. What you need to do is to declare all parameters with proper data type and avoid using Variand variables when you assign values to those parameters

--
Val Mazur
Microsoft MVP


  You are right but I have 30 parameters, If i can see the Statement its much easier,..

    But you build it yourself and you should know what it looks like. Try to do simle test. Do not use any Variant variables and assign value to your parameter using just simple code like

    MyParameter.Value="TestValue"

    --
    Val Mazur
    Microsoft MVP


      Since I'm working also on IBM DB2,
      Is there a way to see the SQL statement?
      I get [IBM][CLI Driver] CLI0112E  Error in assignment. SQLSTATE=22005"
      Boaz

        Hi,

        No, commandtext will be the same. You should check if you have any result in recordset after executing of your command. Something like

        If MyRecordset.EOF then
        'no result
        else
        'there is a result
        endif

        --
        Val Mazur
        Microsoft MVP


          I tried by checking:
          Debug.Print MyCommand.CommandText
          and after setting the parameter, I see the same query with '?' sign.
          So no parameter setting happened.
          Boaz



Sun, 08 May 2005 00:07:37 GMT  
 
 [ 6 post ] 

 Relevant Pages 

1. Need help on ADO commands and parameters

2. Need help with ADO Command.Parameters

3. SQL Server ADO Command Parameters Problem - Please Help

4. command-line-parameter-help needed

5. Also need help with PALETTE (cont.)

6. Urgent Help Needed with ADO/Oracle Parameter Problem...

7. Urgent Help Needed ---> ADO/Oracle Parameter Passing

8. Need help with SQL Command for ADO

9. ADO Command to RecordSet Help Needed

10. multiple ADO command parameters

11. ADO command parameter syntax

12. ADO: Command with parameters

 

 
Powered by phpBB® Forum Software