i have a project connected with sql server 2000...
i want to generate the some reports, for that user should itself enter the dates or codes for reports..
i have created a data environment, called the tables.
now in general tab, i have selected SQL Statement to filter my data from database.
now where i am comparing the field with parameter SELECT * from customer where customercode=text1.text when i am clicking on apply button it errors...

"to retrieve field information for this command, the command must be executed.you may need to specify input parameters values in input parameter tab before the command is executed.execution may add to or modify data in database.

execute command?"

if i am clickin "yes", nothing happens, and pressing No, tit cancels it.
where as the parameter tab is disable, where from i should input the parameter values.

Edited 5 Years Ago by Jaseem Ahmed: n/a

Comments
please give me a down vote, urgently

how about some code

select * from whatever where whatever = '" & textbox1.text & "'

i think u did not read above post correctly!!!! i said this is not working,.,..
and i m writting this code in Data Envirnomnet>>Sql Command.

Hi!!!

Use the following syntax for the SQL Query

SELECT * from customer where customercode = ?

? will display the parameter in the parameter tab

Edited 5 Years Ago by aktharshaik: n/a

I am Using Access 2007 and adodc in Vb6.Please help me how to execute sql by writng code under command button click(). adodc1.recordsource="select * from table1 where[Date]=#7/1/11# does not work. what is the way?
please help me.It is very urgent

Hi,
It is better to start a new thread.
Anyhow here is some solution i can get for u.

Open VB IDE.

1. Insert your ADODC Control in your form.
2. Insert the Command Button.
3. Open the Code Window for Command_Click() and Use this code to set the ADODC Control Properties

Adodc.ConnectionString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" & App.Path & "\test.accdb;Persist Security Info=False"
    Adodc.CommandType = adCmdText
    Adodc.RecordSource = "SELECT * FROM USERS"

Rest you make out and get back if any problem.

Regards
Shaik Akthar

Comments
Thanks

Also refresh the ADODC Control

Adodc.ConnectionString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" & App.Path & "\test.accdb;Persist Security Info=False"
    Adodc.CommandType = adCmdText
    Adodc.RecordSource = "SELECT * FROM USERS"
    [U]Adodc.Refresh[/U]

Edited 5 Years Ago by aktharshaik: n/a

This question has already been answered. Start a new discussion instead.