If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Access 2000 with VB6
Hi!
I have a problem. I am developing a library software of CDs in VB6 with Access 2000. The search command for title, artist and composer are simple involving single fields, but I simply do not know how to search for tracks for which I have 18 field as Track 1 Track 2 .....Track 18 all in a single table. I tried this: Private Sub cmdTrack_Click() prompt$ = "Enter the full Track Name." SearchStr$ = InputBox(prompt$, "Track Search") For i = 1 To datLib.Recordset.Fields.Count - 1 datLib.Recordset.Index = datLib.Recordset.Fields(i).Name datLib.Recordset.Seek "=", SearchStr$ 'and search Next i If datLib.Recordset.NoMatch Then 'if no match datLib.Recordset.MoveFirst End If End Sub But this dosen't work! Please help. |
#2
|
|||
|
|||
Sounds like your database could use a redesign. You shouldn't have 18 fields
in a single record: how are you going to handle those CDs with 19, 20 or more tracks? You need a second table, where you can store each track as a separate row. -- Doug Steele, Microsoft Access MVP http://I.Am/DougSteele (no e-mails, please!) "Ranjan Mitra via AccessMonster.com" wrote in message news:79f02973a08947ba8d06abeb87ce2d83@AccessMonste r.com... Hi! I have a problem. I am developing a library software of CDs in VB6 with Access 2000. The search command for title, artist and composer are simple involving single fields, but I simply do not know how to search for tracks for which I have 18 field as Track 1 Track 2 .....Track 18 all in a single table. I tried this: Private Sub cmdTrack_Click() prompt$ = "Enter the full Track Name." SearchStr$ = InputBox(prompt$, "Track Search") For i = 1 To datLib.Recordset.Fields.Count - 1 datLib.Recordset.Index = datLib.Recordset.Fields(i).Name datLib.Recordset.Seek "=", SearchStr$ 'and search Next i If datLib.Recordset.NoMatch Then 'if no match datLib.Recordset.MoveFirst End If End Sub But this dosen't work! Please help. |
#3
|
|||
|
|||
"Ranjan Mitra via AccessMonster.com" wrote
in news:79f02973a08947ba8d06abeb87ce2d83@AccessMonste r.com: The search command for title, artist and composer are simple involving single fields Not sure that I agree with this. Titles pretty much always single attributes, but it is common to have more than one artist and more than one composer for a CD. You might want to think about putting these in a more normalised structure too. All the best Tim F |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Why is a French Spellchecker a "required" update for English speak | French Spellcheck Required? | General Discussion | 23 | April 26th, 2005 01:17 AM |
Can One Use Access 2003 on Access 2000 Databases? | lbrinkman | New Users | 2 | January 14th, 2005 11:13 PM |
Running Access 2000 RunTime on Windows XP Pro SP 2 | Hemil | General Discussion | 0 | December 16th, 2004 01:37 AM |
Strange behavior moving from Access 97 to Access 2000 | Dirk Goldgar | Using Forms | 2 | October 25th, 2004 06:29 AM |
Access 2000 DB opening with Access 97 | Cathy | General Discussion | 1 | June 8th, 2004 06:16 PM |