|
-
August 10th, 1999, 12:14 AM
#1
Seek Method For Database
I Want To Search A Row In A Database
What Should I Do ???
-
August 10th, 1999, 02:40 AM
#2
Re: Seek Method For Database
to search for "charlie" in an address table:
SELECT * FROM ADDRESS WHERE NAME = 'charlie'
There are many more ways to do that depending on the database backend and the database interface (DAO/ADO).
-
August 10th, 1999, 04:00 AM
#3
Re: Rephrase - Seek Method For Database
ok so the db im using is access
i have a table called "Phones"
there i have 3 columns "Name" , "Address" , "Phone"
how do i search for a name in it
please write me the code
thnx
-
August 10th, 1999, 08:27 PM
#4
Re: Rephrase - Seek Method For Database
Hi,
First, add a "Data Control" into your form. Then, do as below:
Dim dbs as Database
dim recordset as Recordset
dim ssql as String
ssql="SELECT * FROM Phones WHERE Name=' " & Charlie & "' "
Set dbs=Opendatabase ("C:\xxx.mdb")
Set recordset=dbs.OpenRecordSet(ssql,dbOpenDynaset)
With recordset
If Not .EOF and Not .BOF Then
.MoveFirst
Do
strAddress= !Address
strPhone= !Phone
Loop Until .EOF
.Close
End With
dbs.Close
With this, the address and the phone for the particular Name will be hold by strAddress and strPhone respectively.
Gary
-
August 10th, 1999, 08:49 PM
#5
Re: Rephrase - Seek Method For Database
Dim db as database
dim rs as Recordset
set db = opendatabase("c:\xx.mdb")
set rs = db.openrecordset("Select * from master",dbopenSnapshot)
' to select the first match
rs.findfirst "name = 'charlie'"
' check for rs.nomatch
' to select the next match
rs.findnext
rgds
Praba
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|