CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Mar 2001
    Posts
    2

    Data Environment String Parameter

    Help!
    I am using VB 6 Data Environment and Report Designer to generate some reports for my application. I created a Data Environment Command using SQL statement with a parameter for String. The Data Type is adVarChar and Host Data Type is STRING.
    However, I keep getting the error msg "application defined or object defined error" when I run the query in my form. If I defined Data Type as adInteger and Host Data Type as INTEGER, and pass it an integer variable, it is working fine.

    What's the correct way to pass a string to a Data Environment Command? Can someone enlighten me?

    Thanks


  2. #2
    Join Date
    Jul 2001
    Posts
    1

    Re: Data Environment String Parameter

    I know you posted this question back in March, but just in case you have not gotten a response, below is what I did to solve this problem. I too was struggling with this same problem.

    With DataEnvironment1
    If .rsCommand1.State = adStateOpen Then
    .rsCommand1.Close
    End If
    DataEnvironment1.Commands("Command1").CommandText = _
    "SELECT * FROM contactsTable WHERE first ='" & Text1.Text & "'"
    End With

    DataReport1.Show

    I know this is a work-around and so if you know of a better way, PLEASE let me know, but this one seems to work pretty well.

    John


  3. #3
    Join Date
    Mar 2001
    Posts
    2

    Re: Data Environment String Parameter

    Hi John,

    Thanks for replying. I had been using the same workaround as what you had showed me. I posted the message to see whether anyone knows the proper method to use.

    I'm still trying out on this because I am still working on VB database application. If you find out any better method, pls keep me informed. I'll let you know once I find out the way.

    Thanks.


  4. #4
    Join Date
    Jul 2001
    Posts
    3

    Re: Data Environment String Parameter

    Hi,
    I am also facing the same kind of problem. My report works fine where grouping or child command is not used. The moment I use grouping and child command report generates error.
    Kindly suggest me how to calla report with grouping or child command in it with string parametrs.
    Eagerly waiting for your reply.
    Id is [email protected]
    Bye
    Arbind



Posting Permissions

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





Click Here to Expand Forum to Full Width

Featured