Interface and Query of MS-Access from Mathamatica

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am using Mathamatica to generate a table of random numbers. Using one of
those random numbers, I then want to reach into a record number inside an
MS_Access Database that is represented by that random number and then extract
a field from the record.

Anyone up for taking a shot at this one? There seems to be two key problems
here: interfacing and external queries with data extraction.

Maybe an Access macro to import the table of random numbers and then iterate
to gather the data and xmit it back out?

Paul
 
This is a VB script to get a value from a database,
(using the Windows Scripting host).

'start

dim dbe
dim db
dim v
dim sSQL

sSQL = "select * from MyTable where idxRecord = 5"
set dbe = wscript.createobject("dao.dbengine.36")
set db = dbe.OpenDatabase("c:\MyDB.mdb")
v = db.openrecordset(sSQL).fields("MyField")

msgbox v
wscript.quit

'end

As you can see, there are really only four lines there.

You should be able to script this in Mathematica, you
just need to work out the correct language. 'CreateObject'
is the critical element you are looking for. If there
is a Mathematica group, they should be able to help you.

However, it would also be possible to just use a script
like that above to export the value to a text file. If
so, have you tried importing a value from a text file
into mathamatica? Can you describe the text file you
used?

(david)
 
Hi Paul,

I've never used Mathematica, however, it appears as though it can be used
with JET databases via Universal Database Connectivity (UDC):

http://www.wolfram.com/technology/guide/universaldatabase.html

If that is true, then it is likely able to use Structured Query Language
(SQL). You should be able to write an appropriate SQL statement that reads
data from an external JET database. I think there should be no reason to even
use Access. Your query would just need to identify the path to the .mdb file,
the table and field names, and any criteria to select the appropriate
record(s).


Tom

http://www.access.qbuilt.com/html/expert_contributors.html
http://www.access.qbuilt.com/html/search.html
__________________________________________
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top