Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD General Discussion
Gael
Beginner


Joined: 18 Sep 2006
Posts: 29

PostPosted: 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...

Tech wrote:
Your looking for the ADO Programming Guide and possibly the SQL Server guide.


Last edited by Gael on Sat Jan 17, 2009 12:52 am; edited 1 time in total
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4671
Location: Pensacola, FL, USA

PostPosted: 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
Reply with quote
Gael
Beginner


Joined: 18 Sep 2006
Posts: 29

PostPosted: 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.
Reply with quote
Fang Xianfu
GURU


Joined: 26 Jan 2004
Posts: 5155
Location: United Kingdom

PostPosted: 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.
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
Reply with quote
Tech
GURU


Joined: 18 Oct 2000
Posts: 2733
Location: Atlanta, USA

PostPosted: Sat Jan 17, 2009 12:06 am   
 
Your looking for the ADO Programming Guide and possibly the SQL Server guide.
_________________
Asati di tempari!
Reply with quote
Gael
Beginner


Joined: 18 Sep 2006
Posts: 29

PostPosted: Sat Jan 17, 2009 12:37 am   
 
Tech wrote:
Your looking for the ADO Programming Guide and possibly the SQL Server guide.


Ah brilliant! Thanks Tech, that's just what I needed.
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD General Discussion All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

© 2009 Zugg Software. Hosted by Wolfpaw.net