Forum Discussion
1 Reply
Sort By
- NisHeraValued Contributor
why do you need to pass anything for record-set?
It's just a set of record you can not pass anything but read it.
But if what you need is to put a where condition in query string you can do it like this
var DBName = "database1"; var UserID = "NewUser"; var EmpNo = "0000123"; qry = "select my_columnsA, my_columnsB FROM ["+DBName+"].[dbo].[My_Table] where USER_ID="; qry = qry+UserID+" AND EMPNO ="+EmpNo;
note using same "qry" the query string, I can pass what ever i like to DBName, userID and EmpNo
you can get record set like this
ADOCommand.CommandText = qry; RecSet = ADOCommand.Execute();