xcllentPlus
January 16th, 2006, 01:59 AM
Hi
I am using visual basic 6 and sql server 2000
I want to pass an argument (date to display sales record of that day) using visual basic 6
Please inform me how can i do this
thanks
exterminator
January 16th, 2006, 02:19 AM
1. Make an ADODB.Connection with the database. Refer www.connectionstrings.com
2. Make a ADODB.Recordset object
3. Prepare an SQL Query to read records. This would be something like:SELECT column1, column2 <, ...if any more columns to retrieve>
FROM
tablename
WHERE
date_to_display_column = "12/12/2005" <or any other date retrieved from the form as selected by user>
Move through the recordset and do whatever you want. Here's a link with an example about how to do this - MoveFirst, MoveLast, MoveNext, and MovePrevious Methods Example (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/ado270/htm/mdmthmovefirstx.asp). Hope this helps. Regards.