Click to See Complete Forum and Search --> : Data Environment String Parameter


sokonana
March 31st, 2001, 05:58 AM
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

johnv888
July 5th, 2001, 03:21 PM
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

sokonana
July 5th, 2001, 08:27 PM
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.

aksoreng
July 17th, 2001, 11:41 PM
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 aksoreng@iocl.co.in
Bye
Arbind