hi..
im goumang ..
i have a database call test with fields,
std name,roll number,mark,state and category(st,sc,gen). and i want to select a students from this database, based on roll number with a criteria of some cut off mark...pls help me!! i create a FORM with a text field to enter ROLL NO and a COMMAND button..after entering a roll no in the TEXT field and clicking on the COMMAND button i want the std name, roll no., marks and category of those student whose marks satisfy the given criteria(i.e. cut off mark) to be display on a data report.
pls do help me i need to complete it before 29....tanking u in anticipation!!

Using ADO? Know ADO? Use friends (yahoo, google, ask, answers, bing) to search for vb6 ado tutorial...

strSQL = "SELECT [std name], [roll no], marks, category, FROM tablename WHERE [roll no] = " & Text1.Text & " AND marks >=" & somevalue

Now, if roll no is a text field you will need to do...
] '" & Text1.Text & "' AND

see the single ticks (') ? Same goes for marks but marks should be a numeric field.


Future hint for you. If you have M$ Access, you can create a dummy representative database in it to represent neary any kind of database. Fill it will some dummy data and then use the query designer to create your SQL statements. When in the designer, and you have finally figured out that you are getting the right information, you can goto view>SQL and with very little changes to that SQL statement, you can drop it right in to your program...

Good Luck

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.