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
DanteX
Apprentice


Joined: 13 Aug 2007
Posts: 166

PostPosted: Fri Dec 04, 2009 1:40 pm   

Database conversion from zMUD to CMUD 3?
 
Hey all

I wonder if it's possible, and in that case how, to convert a zmud database to CMUD 3? Do I need other software or can it be done in CMUD? Maybe CMUD 3 can access and read/write data to the old databases?

//DanteX
Reply with quote
Rahab
Wizard


Joined: 22 Mar 2007
Posts: 2320

PostPosted: Fri Dec 04, 2009 3:49 pm   
 
A zmud database? Cmud is using the exact same database stuff that zmud did. The database software has not been updated yet. Or do you mean the mapper data? That gets converted fine.

[edited]
Oh, you probably mean converting to the new SQL database connection stuff. Right now, all that feature does is allow you to communicate with an external SQL database. It has nothing to do with the internal database, which I don't believe is actually an SQL system anyway.


Last edited by Rahab on Fri Dec 04, 2009 3:57 pm; edited 1 time in total
Reply with quote
DanteX
Apprentice


Joined: 13 Aug 2007
Posts: 166

PostPosted: Fri Dec 04, 2009 3:57 pm   
 
CMUD 3 is using SQLite, but I have databases in the old Microsoft format. And when I've attempted to call the old databases in the same way as I used to, it's failed and that's why I wonder.
Reply with quote
Zugg
MASTER


Joined: 25 Sep 2000
Posts: 23379
Location: Colorado, USA

PostPosted: Fri Dec 04, 2009 5:13 pm   
 
CMUD only uses SQLite for it's internal databases, and the mapper. If you have an external database in Microsoft ADO/MDAC format, then the same COM-based scripting should work for it as in zMUD. You should post the script that isn't working so we can try to help with it.

To convert a database from Microsoft ADO/MDAC format into SQLite format, you'll need to Google for that. Doing a general-purpose database conversion like that is beyond the scope of CMUD. But I'm sure there is some database tool that will do it somewhere.
Reply with quote
DanteX
Apprentice


Joined: 13 Aug 2007
Posts: 166

PostPosted: Fri Dec 04, 2009 6:04 pm   
 
In CMUD:
#VAR DB1 %comcreate( "ADODB.Recordset")
gives the following DB1 content:

<COMObject>

While the same code in zmud results in the following content:

<OLE object: ADODB.Recordset>

And when I use the same script, with string handling modifications, it will get stuck in an endless loop in CMUD. while it will display correct items in zmud. This is the alias used in CMUD:

Code:

#VAR smobtof %concat( %1, " ", %2, " ", %3, " ", %4, " ", %5, " ", %6, " ", %7, " ", %8)
#var smobtof %replace( @smobtof, "'", "''")
#VAR smobtoft %trim( %delete( @smobtof, 26, 100))
#SHOW smobtof @smobtof
#IF (%len( %trim( @smobtof))) {
  #VAR DB1 %comcreate( "ADODB.Recordset")
  #CALL @DB1.Open( SELECT ObjId FROM Mobs WHERE Name=~'@smobtof~', @MDBConnStr2)
  #MXP %ansi( Red, high)Results for mob: %ansi( White, high)@smobtoft
  #IF (not @DB1.Eof) {
    #WHILE (not @DB1.Eof) {
      #MXP ~<send>runto @DB1( "ObjId")~</send> - %ansi( green, high)%zonename( %roomzone( @DB1( "ObjId"))) %ansi( blue, hign)%roomname( @DB1( "ObjId"))%ansi( grey)
      @DB1.MoveNext
      }
    @DB1.MoveFirst
    }
  }


MDBConnStr2 contains: "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=full path to file name.mdb"

Nothing from the dabase is found, and I get stuck in an endless loop.
Reply with quote
Zugg
MASTER


Joined: 25 Sep 2000
Posts: 23379
Location: Colorado, USA

PostPosted: Mon Dec 07, 2009 9:14 pm   
 
You didn't show what the @MDBConnStr2 variable contains, but I think you need to be more careful putting " quotes around your string values. The #CALL command that you have:

#CALL @DB1.Open( SELECT ObjId FROM Mobs WHERE Name=~'@smobtof~', @MDBConnStr2)

should be this:

#CALL @DB1.Open( "SELECT ObjId FROM Mobs WHERE Name='@smobtof'", @MDBConnStr2)

The fact that CMUD shows instead of the more detailed shown in zMUD isn't a bug, it's just the way CMUD handles COM objects in a more general way than zMUD.

Finally, you don't need the ~ in front of the < charaters in the MXP command. Again, that's left over from zMUD bugs.
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