SQL and Access......lots of help needed! 
Author Message
 SQL and Access......lots of help needed!

I'm having a tough time getting my head around SQL.   I've only just started
as I need a way to search a database in access, the source is below.....the
titles in acces are "Artist" And "Album", I want to search using the artists
name to give a list of the albums by them.
so far all i have is loads of none working code! everything  I've tried
hasn't worked.

thanks..

Wayne...

ps:sorry for the untidy code!

CODE:

Const DBName As String = "mp3 - wayne.mdb"
Dim strPath As String

Dim rsTitles As Recordset
Dim strSQl As String
Dim blnView As Boolean
Private Sub Command1_Click()
With Data1.Recordset
        .Delete
        .MoveNext
      Dim place
      place = .EOF

        If place Then
            .MovePrevious
            If .BOF Then
            MsgBox "there are no records left", vbInformation, "No Records!"
            End If
            End If
            End With
            End Sub

Private Sub Command2_Click()
Data1.Recordset.AddNew
End Sub

Private Sub Command3_Click()
Data1.Recordset.Update
End Sub

Private Sub Command4_Click()
Data1.Recordset.Edit
End Sub

Private Sub Command5_Click()
    Dim rs As Recordset
    Dim db As Database
    Dim strSQl As String

     strSQl = "SELECT * FROM Mp3 - wayne"
         strSQl = strSQl & " WHERE artist LIKE '*" & Text1.Text & "*'"

   Text1.Text = [strSQl]

    'SELECT [Artist], [Album] FROM [mp3 - wayne] WHERE [Artist] LIKE
Text1.Text

End Sub

Private Sub SetRecordNumber()
    'display record number

    Dim intRecordCount  As Integer
    Dim intCurrentRecord  As Integer

    intRecordCout = Data1.Recordset.RecordCount
    intCurrentRecord = Data1.Recordset.AbsolutePosition + 1
    If Data1.Recordset.EOF Then
        Data1.Caption "EOF"
    Else
        Data1.Caption = "Record" & intCurrentRecord & " of " &
intRecordCount

        End If

End Sub



Fri, 17 Oct 2003 01:39:33 GMT  
 SQL and Access......lots of help needed!

Quote:
>Subject: SQL and Access......lots of help needed!

>Date: 4/29/01 12:39 PM Central Daylight

>I'm having a tough time getting my head around SQL.   I've only just started
>as I need a way to search a database in access, the source is below.....the
>titles in acces are "Artist" And "Album", I want to search using the artists
>name to give a list of the albums by them.
>so far all i have is loads of none working code! everything  I've tried
>hasn't worked.

>thanks..

>Wayne...

SQL = "SELECT Table1.Artist, Table1.Album" _
           & " FROM Table1" _
           & " WHERE Table1.Artist = " _
           & Chr(34) & strArtistName & Chr(34) & ";"

HTH,
Merjet



Fri, 17 Oct 2003 02:04:15 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. I need help with SQL in a VB program to access an Access database

2. Need Lots of help; custom menu action

3. Help-need to display lots of text

4. Newbie needs lots of help...

5. Why does this happens? Need lots of help

6. need lots of help with ASP

7. Please read....i need a lot of help.........

8. Please read....i need a lot of help.........

9. VB6 - Newbie needs SQL help sorting using dates in Access DB

10. SQL help needed to select date range from Access DB

11. Need Help With Sql between VB/Access!!

12. Need Help with VB/Access Date Problem (SQL Statement)

 

 
Powered by phpBB® Forum Software