Private Sub ConnectDB(ByRef rID3Title, rID3Artist)
768 On Error GoTo DB_err
'DB Connect setting up
Dim SQLstatement As String
771 SQLCON.ConnectionTimeout = 5 ' Time out for the connection
772 SQLCON.Provider = "sqloledb" ' OLEDB Provider
773 SQLCON.Properties("Network Address").Value = "64.105.xx.xxx,80" ' set the ip address of your sql server
774 SQLCON.CommandTimeout = 10 ' set timeout for 3 minutes
775 SQLCON.Properties("Network Library").Value = "dbmssocn" ' set the network library to use win32 winsock tcp/ip
776 SQLCON.Properties("Data Source").Value = "SERVER"
777 SQLCON.Properties("Initial Catalog").Value = "Database"
778 SQLCON.CursorLocation = adUseServer ' For ADO cursor location
'SQLCON.Properties("Integrated Security").Value = "SSPI"
779 SQLCON.Properties("User ID").Value = "xxxxxx"
780 SQLCON.Properties("Password").Value = "xxxxxx"
781 SQLCON.Open
'Setup done
782 SQLstatement = "SELECT dbo.Cover.Album, dbo.Cover.Cover, dbo.Artist.URL " _
& "FROM dbo.Artist INNER JOIN " _
& "dbo.Cover ON dbo.Artist.Artist = dbo.Cover.Artist INNER JOIN " _
& "dbo.Track ON dbo.Cover.Album = dbo.Track.Album " _
& "WHERE (dbo.Track.Track = N'" & Replace(rID3Title, "'", "") & "') AND " _
& "(dbo.Artist.Artist = N'" & Replace(rID3Artist, "'", "") & " ')"
783 RS.Open SQLstatement, SQLCON
784 Exit Sub
DB_err:
792 RS.Close
793 SQLCON.Close
794 Set RS = Nothing
795 Set SQLCON = Nothing
End Sub