Jump to content
** April Poker League Result : 1st Like2Fish, 2nd McG, 3rd andybell666 **

sumuwin

New Members
  • Posts

    49
  • Joined

  • Last visited

Posts posted by sumuwin

  1. Re: Anyone want a horse racing database ? Hi Tull I don't use PatternForm but a few years ago I wrote some code in Excel (2003) that would open PatternForm in an browser in Excel and with a few clicks, copy the data e.g. Lifetime, Course, Going etc into separate sheets depending on what you selected. If you want to send me a sample of what you do for one race I'll see if I can adapt this to do what you need. (If anyone wants a copy of the spreadsheet just pm me.) atb sumuwin

  2. Re: Race Results download Hi here are a couple of sources Monthly CSV files are available here http://82.153.163.104/Archive_UKHorseRacing/CSVResults/default.asp or you could download RacingSense from here (over 200mb zipped) http://www.simplesoftware.co.uk/ssr1.htm If you want to grab your own data Sporting Life is probably the easiest - I have some excel vba code that gets the basic info from here if you want it (saves to "normalised" text files as well for database import) There's also some good stuff in this thread if you want to scrape the Racing Post but they tend to change their pages pretty frequently http://www.punterslounge.com/forum/f23/getting-data-rp-online-cards-29624/ all the best sumuwin

  3. Re: Anyone want a horse racing database ? With some modification you can use vbscript to create the database and to provide the updates. The update code could be automated from your SQL files but it's probably easier to create csv files for the user to import. Here's some sample code - copy into a text editor (e.g. notepad) and save the file with extension vbs. Double click the file to run.

    To create database C:\sumuwin.mdb
     
    strFileName = "C:\sumuwin"
    Set objCatalog = CreateObject("ADOX.Catalog")
    objCatalog.Create "Provider = Microsoft.Jet.OLEDB.4.0;Data Source =" & strFileName & ".Mdb" & ";"
    Set objConnection = CreateObject("ADODB.Connection")
    objConnection.Open "Provider = Microsoft.Jet.OLEDB.4.0;Data Source =" & strFileName & ".Mdb" & ";"
     
    objConnection.Execute "Create Table Horse(" & _
    "HorseID long not null," & _
    "Name varchar(25) null," & _
    "Registration_country varchar(3) null,[DateofBirth] datetime null," & _
    "Sex varchar(25) null , Breeding varchar(255) null, Primary Key (HorseID))"
    objConnection.Execute "Create Table jockey(" & _
    "JockeyID counter," & _
    "lastName varchar(50) default null," & _
    "firstname varchar(50) default null,firstinitial char(5) default null," & _
    "Title varchar(15) default null , Gender byte default null)"
     
    objConnection.Close
    Set objCatalog = Nothing
    Set objConnection  = Nothing
     
    MsgBox strfilename & " has been created."
     
    
    To update Horse details
     
    strFileName = "C:\sumuwin"
     
    Set objConnection = CreateObject("ADODB.Connection")
    objConnection.Open "Provider = Microsoft.Jet.OLEDB.4.0;Data Source =" & strFileName & ".Mdb" & ";"
     
    mySQL = "delete * from horse where HORSEID IN " _
    & "(89083,89244,91618,94637,97245,98569,98580,100039)"
    objConnection.Execute mySQL
    REM create a string containing all the horse fields then create array from the string
    REM loop through the array and insert the values
    mystr = ""
    mystr = mystr & "(89083,'Kaiser Willie','IRE');"
    mystr = mystr & "(89244,'Protiva','GBR');"
    mystr = mystr & "(91618,'Yellow Printer','GBR');"
    mystr = mystr & "(94637,'Winrob','GBR');"
    mystr = mystr & "(96063,'Young Star Gazer','GBR');"
    mystr = mystr & "(97245,'Niceonefrankie','GBR');"
    mystr = mystr & "(98569,'Caucus','GBR');"
    mystr = mystr & "(98580,'Top Spin','IRE');"
    mystr = mystr & "(100039,'Futurist','GBR')"
    myarray = Split(mystr, ";")
    For i = 0 To UBound(myarray)
    myvalues = myarray(i)
    mySQL="Insert into horse (HORSEID,name,registration_country) " _
    & " values " & myvalues & ""
    objConnection.Execute mySQL
    Next
     
    objConnection.Close
    Set objConnection = Nothing
     
    MsgBox "Horses Updated."
     
    

    all the best sumuwin

  4. Re: Anyone want a horse racing database ? Hi Datapunter I can take a look at it in Access. I already have several large Access databases and have been intending to migrate to mySQL or SQLServer for a while - just haven't found the time. I may also be able to provide some data that might be of use - pm me if you want to discuss. all the best sumuwin

  5. Re: RP Link extractions from Web to EXCEL This will do what you want. You can do up to 7 days at once. You just need to enter the start and end dates.

    Sub RaceDates() Dim startdate, enddate Dim mystart, myend Dim startday, startmonth, startyear Dim endday, endmonth, endyear Dim myURL startdate = InputBox("Enter Start Date as dd/mm/yy") enddate = InputBox("Enter End Date as dd/mm/yy") Application.ScreenUpdating = False Range("A1").Select startday = Format(CInt(Day(startdate)), "00") startmonth = Format(CInt(Month(startdate)), "00") startyear = CInt(Year(startdate)) endday = Format(CInt(Day(enddate)), "00") endmonth = Format(CInt(Month(enddate)), "00") endyear = CInt(Year(enddate)) myURL = "URL;http://www.racingpost.co.uk/horses/result_search.sd?crs=&r_date=&start_search=1&search_title=Title+or+part+of&search_country=GB&search_course=Any" mystart = "&from_day=" & startday & "&from_month=" & startmonth & "&from_year=" & startyear & "" myend = "&until_day=" & endday & "&until_month=" & endmonth & "&until_year=" & endyear With ActiveSheet.QueryTables.Add(Connection:=myURL & mystart & myend, Destination:=ActiveCell) .FieldNames = True .BackgroundQuery = True .RefreshStyle = xlInsertDeleteCells .SavePassword = False .SaveData = True .AdjustColumnWidth = True .RefreshPeriod = 0 .WebSelectionType = xlSpecifiedTables .WebFormatting = xlWebFormattingAll .WebTables = "8" .WebPreFormattedTextToColumns = True .WebConsecutiveDelimitersAsOne = True .WebSingleBlockTextImport = True .WebDisableDateRecognition = True .WebDisableRedirections = True .Refresh BackgroundQuery:=False End With Cells.Select With Selection .VerticalAlignment = xlBottom .WrapText = False .MergeCells = False End With Columns("A:B").Select Selection.Delete Shift:=xlToLeft Columns("B").Select Selection.Delete Shift:=xlToLeft Range("A1").Select myrows = Cells(Rows.Count, 1).End(xlUp).Row For i = 1 To myrows If Cells(i, 1).Hyperlinks.Count > 0 Then Cells(i, 1).Offset(0, 1).Value = Cells(i, 1).Hyperlinks(1).Address End If Next i Columns("B:B").Select Selection.Replace What:="*horses/", replacement:="", LookAt:=xlPart, _ SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _ ReplaceFormat:=False Application.screenupdating=True End Sub
    I have code that does the rest too (ie. get the results). all the best sumuwin
×
×
  • Create New...