Home | Webstore
Latest News: OOTP Update 20.5.52 - OOTP 20 Available - FHM 5 Available

  

Go Back   OOTP Developments Forums > Out of the Park Baseball 20 > OOTP Mods > OOTP Mods - Database Tools

OOTP Mods - Database Tools Do you need to take a dump? SQL gurus welcome

Reply
 
Thread Tools
Old 05-23-2006, 11:08 AM   #1
dim13
Minors (Triple A)
 
Join Date: Jan 2002
Posts: 277
Thanks: 1
Thanked 39x in 30 posts
How do you get the ms_access dump into Access ?

How do you get the ms_access dump into Access ? How do you run the scripts in Access ?

Thanks.
dim13 is offline   Reply With Quote
Old 05-24-2006, 02:52 PM   #2
rcbuss
Minors (Triple A)
 
rcbuss's Avatar
 
Join Date: Apr 2002
Location: Mauston, WI
Posts: 226
Thanks: 0
Thanked 2x in 2 posts
Good question. I'm wondering the same thing.

I have access to Access, and would rather go with that, than starting to learn a variation of SQL (if I don't have to).
__________________
Robert C Buss
FOBL Mauston Mad Cows
rcbuss is offline   Reply With Quote
Old 05-24-2006, 03:07 PM   #3
billethius
All Star Reserve
 
billethius's Avatar
 
Join Date: Apr 2004
Posts: 822
Thanks: 1
Thanked 9x in 6 posts
I'd imagine that Marc will be posting whatever tools have been submitted to the contest referenced in this thread in not too long of a time.
billethius is offline   Reply With Quote
Old 05-25-2006, 06:09 AM   #4
Andreas Raht
Administrator
 
Andreas Raht's Avatar
 
Join Date: Jun 2002
Location: Hollern/Stade/Germany
Posts: 8,834
Thanks: 855
Thanked 4,829x in 1,561 posts
Quote:
Originally Posted by dim13
How do you get the ms_access dump into Access ? How do you run the scripts in Access ?

Thanks.
Marc will post the tools that are currently in development on the OOTP2006 site... but until then feel free to use this simple script. Just create an empty Access database, create a Modul and insert the code. Start it with F8 or F5. Or create a form, with a button, with the code "behind it".

ATTENTION!!!! No support for this script, and use at your own risk


Code:
Sub import()
Dim fso As FileSystemObject
Dim fo As Folder
Dim f As File
Dim t As TextStream
Dim z As String
Dim i As Long
Dim db As Database
On Error GoTo err_sub
Set db = CurrentDb()
Set fso = New FileSystemObject
Set fo = fso.GetFolder("C:\ootp\data\saved_games\New Game.lg\import_export")
For Each f In fo.Files
    If f.Name Like "*.access.sql" Then
        
        Debug.Print
        Debug.Print f.Name
        DoEvents
        
        Set t = f.OpenAsTextStream(1)
        i = 0
        Do While Not t.AtEndOfStream
            i = i + 1
            z = t.ReadLine
            z = Trim$(z)
            If z <> "" Then
                db.Execute z, dbFailOnError
            End If
        Loop
        t.Close
        Set t = Nothing
        
    End If
Next f
MsgBox "Done!"
exit_sub:
    On Error Resume Next
    db.Close
    Exit Sub
    
err_sub:
    Debug.Print
    Debug.Print Err.Description
    If z Like "DROP TABLE*" Then
        Resume Next
    Else
        If MsgBox("" & f.Name & vbCrLf & t.Line & vbCrLf & z, vbOKCancel, "Error") = vbOK Then
            Resume Next
        Else
            Resume exit_sub
        End If
    End If
    
End Sub
Andreas Raht is offline   Reply With Quote
Old 05-25-2006, 11:15 PM   #5
rcbuss
Minors (Triple A)
 
rcbuss's Avatar
 
Join Date: Apr 2002
Location: Mauston, WI
Posts: 226
Thanks: 0
Thanked 2x in 2 posts
Thanks, Andreas, I'll have to give that a try.

What I ended up doing, this time, was importing the .csv files one by one into Access.
__________________
Robert C Buss
FOBL Mauston Mad Cows
rcbuss is offline   Reply With Quote
Old 05-27-2006, 08:30 PM   #6
Comedian2004
Hall Of Famer
 
Comedian2004's Avatar
 
Join Date: Nov 2004
Location: In a house in Saint Cloud, Florida.
Posts: 7,085
Thanks: 0
Thanked 79x in 45 posts
It does not work in Access 2003
__________________
Like BLUES? Visit www.smokestacklightnin.com, you will LOVE it! New show every Monday!! New Blues HOF![/COLOR][/FONT]
Comedian2004 is offline   Reply With Quote
Old 05-27-2006, 09:00 PM   #7
rcbuss
Minors (Triple A)
 
rcbuss's Avatar
 
Join Date: Apr 2002
Location: Mauston, WI
Posts: 226
Thanks: 0
Thanked 2x in 2 posts
I'm using Access 2002 at home, which is a different version from what I have at work.

I went through File --> Get External Data --> Import

Is that the part that Access 2003 won't let you do?
__________________
Robert C Buss
FOBL Mauston Mad Cows
rcbuss is offline   Reply With Quote
Old 05-27-2006, 11:45 PM   #8
Comedian2004
Hall Of Famer
 
Comedian2004's Avatar
 
Join Date: Nov 2004
Location: In a house in Saint Cloud, Florida.
Posts: 7,085
Thanks: 0
Thanked 79x in 45 posts
I have not tried the CSV, I know that should work, but was talking about his VB code in the above example.
__________________
Like BLUES? Visit www.smokestacklightnin.com, you will LOVE it! New show every Monday!! New Blues HOF![/COLOR][/FONT]
Comedian2004 is offline   Reply With Quote
Old 05-28-2006, 09:03 AM   #9
jarmenia
Hall Of Famer
 
jarmenia's Avatar
 
Join Date: Mar 2002
Location: Tampa, FL USA
Posts: 4,490
Thanks: 79
Thanked 163x in 85 posts
Quote:
Originally Posted by Comedian2004
It does not work in Access 2003
I put access 2003 code in this thread: http://www.ootpdevelopments.com/boar...=118106&page=2

Post 51
__________________
When is good enough, good enough?

jarmenia is offline   Reply With Quote
Old 06-02-2006, 11:18 AM   #10
tysok
Hall Of Famer
 
Join Date: Aug 2003
Posts: 4,925
Thanks: 0
Thanked 12x in 6 posts
Quote:
Originally Posted by rcbuss
Thanks, Andreas, I'll have to give that a try.

What I ended up doing, this time, was importing the .csv files one by one into Access.
Just create tables in access linked to the .csv files. Then when you do a .csv dump from the game, your access program is automatically updated with whatever new information is now in those .csv files. (I'm in Access 97, but think linking is in all of them) I had to edit all the column headings the first time, but better than importing that you have to do everytime.

Fairly easy, I didn't care to go into anything deeper since I'm just doing this for fun, and trying to go deeper would result in the loss of the rest of my hair.
tysok is offline   Reply With Quote
Reply

Bookmarks

Thread Tools

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 06:05 PM.

 

Major League Baseball trademarks and copyrights are used with permission of MLB Advanced Media, L.P. Minor League Baseball trademarks and copyrights are used with the permission of Minor League Baseball. All rights reserved.

The Major League Baseball Players Association (www.MLBPLAYERS.com ) is the collective bargaining representative for all professional baseball players of the thirty Major League Baseball teams and serves as the exclusive group licensing agent for commercial and licensing activities involving active Major League baseball players. On behalf of its members, it operates the Players Choice licensing program and the Players Choice Awards, which benefit the needy through the Major League Baseball Players Trust, a charitable foundation established and run entirely by Major League baseball players. Follow: @MLB_Players; @MLBPAClubhouse; @MLBPlayersTrust

Out of the Park Baseball is a registered trademark of Out of the Park Developments GmbH & Co. KG

Google Play is a trademark of Google Inc.

Apple, iPhone, iPod touch and iPad are trademarks of Apple Inc., registered in the U.S. and other countries.

COPYRIGHT © 2017 OUT OF THE PARK DEVELOPMENTS. ALL RIGHTS RESERVED.

 

Powered by vBulletin® Version 3.8.10
Copyright ©2000 - 2019, vBulletin Solutions, Inc.
Copyright © 2018 Out of the Park Developments