I have designed a report using DataEnvironment as the Datasource.
My Report have two parameters, one is of Integer type and the other is of String (Char) type.
My Query works fine for Integer datatype, but when I add the string datatype then it gives me an error.
In the parameter tab in dataenvironment what datatype to be selected when it is a string parameter. I have tried with all adstr,adlongstr,adchar etc but of no help.
I am using Access 2000 as my Database.
The error generated is Error No 13, Type Mismatch.
I am passing the parametes from VB. The sql query in dataenvironment is as below :
Code:
select OrderEntry.Code,CustOrderNo,OrderDate,OrderSrNo,ItemName,Measurement,OrderQty from OrderEntry,OrderEntryDetails,ItemMaster where OrderEntry.Code=OrderEntryDetails.OrderCode and OrderEntryDetails.ItemCode=ItemMaster.Code and CustomerCode=? and OrderDate between ? and ? and Status=?
Where parameter 1 is Integer, Parameters 2 & 3 are Date/Time and Parameter 4 is String (Char)
Try using the following sql statement since yours has a typo (OrderEntryDetaisl).
select CustomerName,CustOrderNo,OrderDate,OrderQty,Measurement from OrderEntry,OrderEntryDetails,CustomerMaster where OrderEntry.CustomerCode=CustomerMaster.Code and OrderEntry.Code=OrderEntryDetails.OrderCode and ItemCode=? and OrderDate between ? and ? AND Status = ?
And also don't forget to select the correct Host Data Type, if your Data Type is adDate then your Host Data Type should be date, etc.
For the third parameter the following setting worked for me.
Regards,
™
As a gesture of gratitude please consider rating helpful posts. c",)
I tried using your suggestion of setting the 4th parameter's data type and Host Data Type , but I am getting the error. Pls check the error image attached.
I have not changed the query as I want ItemName on the report instead CustomerName.
Not sure if it is an ODBC issue since it works when I tried it with OledDb using the following connectionstring: "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Stuffs\DataEnvi-Problem\DataEnvi-Problem\Database\CurrYear\data.mdb;Persist Security Info=False".
Regards,
™
As a gesture of gratitude please consider rating helpful posts. c",)
In Data Environment, if I change the Provider from ODBC to Jet 4.0, then it worked fine for me. There is no error and getting the desired output.
But this is Ok on my machine. The data path on my machine and client's machine is not the same. Is there any way to set the provider for Data Environment at run time.