PDA

Click to See Complete Forum and Search --> : Database Help!


Smie
Jan 6th, 2000, 06:36 AM
How can I search a database?

jritchie
Jan 6th, 2000, 06:39 AM
Search the database for what ? What database format ? If record set could use SQL.

Smie
Jan 6th, 2000, 06:42 AM
Im not used to databases. But i need to search for a certain record.

jritchie
Jan 6th, 2000, 06:50 AM
Ok sorry support call came up

So if you are using access/sqlv6 or 7

In Declarations something like

Private db as database
Private rs as recordset
Private sSQL as string

Say a search command button

Private Command1_Click()

if a single record, searching for name smith

rs.findfirst("Name = 'Smith'")

if multple records

sSQL = "SELECT * FROM Customer WHERE Name = 'Smith'"

set rs = db.openrecordset(sSQL)

This will set the rs object to only Customer records where field Name = Smith

Hope it helps. :)

jritchie
Jan 6th, 2000, 08:32 AM
Sorry l keep having to any answer service calls :( if it wasn't for users this job would be so much easier. Anyway where was l, ok if you want an example project of searching a database email me at jritchie@genauto.com and l will send you one. :)