Latest News: OOTP 13 Announced with Screenshots & Feature List! Pre-Order Now! - OOTP Baseball 12 Available! - iOOTP Baseball 2011 Available! - Title Bout Championship Boxing 2.5 released! - Inside the Park Baseball Patch 1.03 released, DEMO now available

Pre-Order OOTP 13, Save & Win! | OOTP 12 Off-Season Special, just $19.99!

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

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

Reply
 
LinkBack Thread Tools Display Modes
Old 05-23-2006, 12:08 PM   #1 (permalink)
Minors (Double A)
 
Join Date: Jan 2002
Posts: 162
Thanks: 0
Thanked 4x in 4 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, 03:52 PM   #2 (permalink)
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, 04:07 PM   #3 (permalink)
All Star Reserve
 
billethius's Avatar
 
Join Date: Apr 2004
Posts: 806
Thanks: 1
Thanked 1x in 1 post
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 (permalink)
Administrator
 
Andreas Raht's Avatar
 
Join Date: Jun 2002
Location: Hollern/Stade/Germany
Posts: 6,468
Thanks: 146
Thanked 1,088x in 415 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-26-2006, 12:15 AM   #5 (permalink)
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, 09:30 PM   #6 (permalink)
Hall Of Famer
 
Comedian2004's Avatar
 
Join Date: Nov 2004
Location: In a house in Saint Cloud, Florida.
Posts: 6,870
Thanks: 0
Thanked 22x in 14 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, 10:00 PM   #7 (permalink)
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-28-2006, 12:45 AM   #8 (permalink)
Hall Of Famer
 
Comedian2004's Avatar
 
Join Date: Nov 2004
Location: In a house in Saint Cloud, Florida.
Posts: 6,870
Thanks: 0
Thanked 22x in 14 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, 10:03 AM   #9 (permalink)
Hall Of Famer
 
jarmenia's Avatar
 
Join Date: Mar 2002
Location: Tampa, FL USA
Posts: 4,276
Thanks: 26
Thanked 43x in 29 posts
Quote:
Originally Posted by Comedian2004
It does not work in Access 2003
I put access 2003 code in this thread: TRTR Day 16 : I need to take a dump

Post 51
__________________
When is good enough, good enough?

jarmenia is offline   Reply With Quote
Old 06-02-2006, 12:18 PM   #10 (permalink)
Hall Of Famer
 
Join Date: Aug 2003
Posts: 4,923
Thanks: 0
Thanked 6x in 4 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
Display Modes

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
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -4. The time now is 11:53 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.
Search Engine Friendly URLs by vBSEO 3.6.0
Copyright © 2009 Out of the Park Developments