Opening mdb access file without access
I don't have access to Microsoft, but you want to open the mdb file, is there a way to do this?
The mdb file contains the SQL code that I need. it's just a file that connects to the remote database. I need to view the sql code
I tried to open the openoffice base but it only showed me a few tables. I can't see where the sql code is?
+2
source to share
5 answers
This VBScript will print the SQL statements from the stored queries in the MDB database.
Option Explicit Dim dbe Dim db Dim qdf Set dbe = CreateObject("DAO.DBEngine.36") 'change the next line to include the full path to your database Set db = dbe.OpenDatabase("C:\SomeFolder\YourDatabase.mdb") For Each qdf In db.QueryDefs If Left(qdf.Name,1) <> "~" Then Wscript.StdOut.WriteLine qdf.Name Wscript.StdOut.WriteLine qdf.SQL Wscript.StdOut.WriteLine String(20, "-") End If Next Set db = Nothing Set dbe = Nothing
I saved it as DumpQuerySQL.vbs and then executed it from the command line like this:
cscript DumpQuerySQL.vbs > querySQL.txt
+5
source to share