This is a tough one, I think

D

dsc

I did a word macro to search an Access database .mdb file and paste to a
word document (with extensive assistance from this Newsgroup), but now my
adoring public is calling for more.

The search function is very simple, of the "if (field1) = searchstring"
type. Now I'm being asked for a fuzzy search of the database, so that a
search on a single word will return all fields containing that word
regardless of what else they contain.

Is that even possible? Would it require calling Access and using its fuzzy
search capabilities to write to an array?

Any assistance would be sincerely appreciated.
 
E

Elliot

Create the query you want in the access query and then
copy the sql view code of the query into **.
Open a recordset and database as below:

Dim con As New ADODB.Connection
Dim rs As New ADODB.Recordset
Dim intRecsFound As Integer


'Open an ADO connection
Set con = New ADODB.Connection
con.Open "Provider=Microsoft.Jet.OLEDB.4.0;"
& "Data Source= path"

' Display the state of the connection.
'MsgBox "ok con state: " & GetState(con.State) &
vbCr
Set rs = New ADODB.Recordset
rs.CursorLocation = adUseClient

** rs.Open "SELECT field,field ,etc ptnr_no FROM
table WHERE condition = ? order by ptnr_name", con,
adOpenDynamic, adLockReadOnly, adCmdText
intRecsFound = rs.RecordCount


etc.....

Regards
 
D

dsc

Sorry to take so long to acknowledge your message. Got busy at work.

Haven't tried your solution yet. Will get back to you later on that.

Thanks a million.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top