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

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD Beta Forum
charneus
Wizard


Joined: 19 Jun 2005
Posts: 1876
Location: California

PostPosted: Sat Jan 17, 2009 12:55 am   

Map database , COM connections, Vijilante's toolbox
 
This is based off Vijilante's toolbox.

Code:

 #VAR MapCon {%comcreate("ADODB.Connection")}
 #CALL @MapCon.Open(%concat("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=",%pref(MapFile)))


obviously no longer works since it's no longer in mdb format. So, what provider should I use? Or more specifically, how can I get this to work?

Charneus
Reply with quote
Anaristos
Sorcerer


Joined: 17 Jul 2007
Posts: 821
Location: California

PostPosted: Sat Jan 17, 2009 5:48 am   
 
After integrating access to Sqlite3 using Dharkael's toolkit described here, you can access the map database directly using something like this:
Code:

#VAR commap %comcreate( "Sqlite.zMUD.wsc")
;;
#CALL %comset( commap, CMUDFormat, 1)  //Force returned data as database records.
;;
$sql = "SELECT * FROM [ObjectTbl] WHERE [Name] = ?"
;;
$rec = @commap.Execute($sql,"New Orchard Entrance (G)")
;;
#ECHO %db($rec,Name)

This will return the database record for that particular room and it should display the room name in this instance.
_________________
Sic itur ad astra.
Reply with quote
Fang Xianfu
GURU


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

PostPosted: Sat Jan 17, 2009 6:25 am   
 
Mmm, you need to use Sqlite. But tools are coming in future versions to allow you to do this sort of thing directly through zScript, without having to call COM, so code with that in mind.
_________________
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 5:19 pm   
 
Indeed.. you can also access SQLite via lua using the instructions I describe here.

But when the mapper is rewritten, there'll be many more features for accessing the map DB. Similarly I expect the same thing to occur when Database component is rewritten.
_________________
Asati di tempari!
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD Beta Forum 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