> I have student databse in MS access namely "student.mdb" the table name is "stu"(D:\muthu\student.mdb) with three fields namely 1.regno 2. name 3. category.
>
> In vfp I have designed "Student.scx" in that i put one text box namely txtsearch and one two command button namely 1. cmdsearch 2.cmdexit.
>
> I have enterd letter of students name in txtsearch box and click cmdsearch button and result will be in browse window.
>
> let assume I have enterd "A" in txtsearch box and click command button whose student names begain with "A" will dispaly in browse window. or if I have enterd "B" in txtsearch box and click command button whose student names begain with "B" will dispaly in browse window.
>
> How to write code?
CREATE DATABASE School
CREATE CONNECTION Xx CONNSTRING [ get an Ms Office Access ODBC connectionstring from www.connectionstrings.com]
CREATE VIEW vStudents REMOTE CONNECTION Xx AS SELECT * FROM Students WHERE UPPER(name) LIKE ?lcSearchString
You can also do all of that clicking the buttons in your Project Manager's Data page
Open the form's DataEnvironment and add this view. An image of the columns of the view will appear in the DataEnvironment. Drag this image to the form and a Grid will be added in the form.
In the DataEnvironment window right-click the view and choose Properties.
Mark
NoDataOnLoad True.
In the Grid's Init event add this code
lcSearchString ='A%'
REQUERY('vStudents')
In cmdSearch.Click add this.code
lcSearchString=ALLTRIM(UPPER(Thisform.txtSearch.Value) )+'%'
REQUERY('vStudents')
Bravo. You created a working parameterized remote view. See VFP's Help for these keywords.
-Anders