A Microsoft Office (Excel, Word) forum. OfficeFrustration

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.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Database Design
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Access 2000 with VB6



 
 
Thread Tools Display Modes
  #1  
Old May 17th, 2005, 08:23 PM
Ranjan Mitra via AccessMonster.com
external usenet poster
 
Posts: n/a
Default 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  
Old May 18th, 2005, 01:12 AM
Douglas J. Steele
external usenet poster
 
Posts: n/a
Default

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  
Old May 18th, 2005, 05:04 PM
Tim Ferguson
external usenet poster
 
Posts: n/a
Default

"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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

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


All times are GMT +1. The time now is 12:00 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.