Home | Webstore
Latest News: OOTP 25 Available - FHM 10 Available - OOTP Go! Available

Out of the Park Baseball 25 Buy Now!

  

Go Back   OOTP Developments Forums > Out of the Park Baseball 25 > 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, 12:08 PM   #1
dim13
Major Leagues
 
Join Date: Jan 2002
Location: tucson, az
Posts: 338
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, 03:52 PM   #2
rcbuss
Minors (Triple A)
 
rcbuss's Avatar
 
Join Date: Apr 2002
Location: Mauston, WI
Posts: 226
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, 04:07 PM   #3
billethius
All Star Reserve
 
billethius's Avatar
 
Join Date: Apr 2004
Posts: 822
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, 07:09 AM   #4
Andreas Raht
Administrator
 
Andreas Raht's Avatar
 
Join Date: Jun 2002
Location: Hollern/Stade/Germany
Posts: 8,992
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-26-2006, 12:15 AM   #5
rcbuss
Minors (Triple A)
 
rcbuss's Avatar
 
Join Date: Apr 2002
Location: Mauston, WI
Posts: 226
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, 09: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
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, 10:00 PM   #7
rcbuss
Minors (Triple A)
 
rcbuss's Avatar
 
Join Date: Apr 2002
Location: Mauston, WI
Posts: 226
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-28-2006, 12:45 AM   #8
Comedian2004
Hall Of Famer
 
Comedian2004's Avatar
 
Join Date: Nov 2004
Location: In a house in Saint Cloud, Florida.
Posts: 7,085
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, 10:03 AM   #9
jarmenia
Hall Of Famer
 
jarmenia's Avatar
 
Join Date: Mar 2002
Location: Tampa, FL USA
Posts: 4,503
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, 12:18 PM   #10
tysok
Hall Of Famer
 
Join Date: Aug 2003
Posts: 4,925
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 10:15 PM.

 

Major League and Minor League Baseball trademarks and copyrights are used with permission of Major League Baseball. Visit MLB.com and MiLB.com.

Officially Licensed Product – MLB Players, Inc.

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 © 2023 OUT OF THE PARK DEVELOPMENTS. ALL RIGHTS RESERVED.

 

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