How can I use SQL Statements in VB 6 with DataEnvironment.

I have a DataEnvironment called Table(DataEnvironment2.Dsr) and a report named rptStudMastOne(rptStudMastOne.Dsr). I am planning to use the SQL Statement " SELECT * FROM Student WHERE StdSSN = txtStdSSN " and it will show in the report the record that has a StdSSN that is equal to the number inputed in the txtStdSSN but I don't know where to put it.

Recommended Answers

All 3 Replies

Is your SQL is on a command button (ex: cmdPrin Selected).?

Is your SQL is on a command button (ex: cmdPrin Selected).?

My SQL is not on a command button. It is on a DataEnvironment - Comand. The only code inside my cmdPrint button is rptStudMastOne.Show.

you have to set parameter in DataEnvironment for txtStdSSN.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.