|
Gael Beginner
Joined: 18 Sep 2006 Posts: 29
|
Posted: Thu Jan 15, 2009 11:16 pm
[2.37] Script to to query an external Access (MDB) Database? [Answered] |
From the command line or via other aliases/scripts, I would like to be able to send queries to an external Jet database (MS Access .mdb) via a CMud script, and then display the results in a CMud window (or send the result as a command). I've made a couple of tries at this using VBScript without too much success.
I'm sure that someone, somewhere has done this already so rather than trying to re-invent the wheel I thought I'd ask here. I wasn't really able to find anything specifically related to this by searching the forum.
I'm not fussed about which language is used, though I know VBScript better than others so that might be preferable.
Any help pointing me to a link/script/good approach to take would be much appreciated!
Thanks.
Edit: To save further reading of the thread, here's what I needed...
|
|
Last edited by Gael on Sat Jan 17, 2009 12:52 am; edited 1 time in total |
|
|
|
shalimar GURU
Joined: 04 Aug 2002 Posts: 4691 Location: Pensacola, FL, USA
|
Posted: Thu Jan 15, 2009 11:27 pm |
have you tried using #DBLOAD "fullpathname"?
You could always just make an alias via the settings editor and change the script to VBScript as well. |
|
_________________ Discord: Shalimarwildcat |
|
|
|
Gael Beginner
Joined: 18 Sep 2006 Posts: 29
|
Posted: Thu Jan 15, 2009 11:37 pm |
The database I'm trying to query isn't a CMud style database - it's something completely separate. As I understand it, the #DBxxx commands are just for CMud databases (even if they are in .mdb format)?
In essence I'm just trying to turn a generic database query into a string that can be displayed or sent. I can do the scripting for the formatting alright. It's just establishing the connection, running the query, and then sending the results back to CMud I'm having trouble. |
|
|
|
Fang Xianfu GURU
Joined: 26 Jan 2004 Posts: 5155 Location: United Kingdom
|
Posted: Fri Jan 16, 2009 4:08 am |
You can use COM to do this kind of scripting. There should be documentation on the web of the Jet/.mdb COM interface. If you want to see a working example, download Vijilante's toolbox from the package library, which uses COM and MDAC to open the map file the mapper is using.
|
|
|
|
Tech GURU
Joined: 18 Oct 2000 Posts: 2733 Location: Atlanta, USA
|
|
_________________ Asati di tempari! |
|
|
|
Gael Beginner
Joined: 18 Sep 2006 Posts: 29
|
Posted: Sat Jan 17, 2009 12:37 am |
Ah brilliant! Thanks Tech, that's just what I needed. |
|
|
|
|
|