 |
liujc Beginner
Joined: 02 Mar 2007 Posts: 23 Location: China, BeiJing
|
Posted: Fri Mar 02, 2007 12:51 pm
How to use two database? |
I tried to load two database, for example: npc.db and weapon.db. But it seems the zmud only support one database at the one time. I rewrote my program, closed the every database after used, but I found it is slow when load or close the database. What should I do?
|
|
|
 |
MattLofton GURU
Joined: 23 Dec 2000 Posts: 4834 Location: USA
|
Posted: Fri Mar 02, 2007 9:46 pm |
to load two databases, use the #DBLOAD command. You could alternatively do this via the DB Module GUI, as well. In either case, the last load operation will be the database that is available to all of the data-related commands and functions.
Not sure if there's a long-name method to directly access a database, however, but I doubt there is. |
|
_________________ EDIT: I didn't like my old signature |
|
|
 |
Arminas Wizard
Joined: 11 Jul 2002 Posts: 1265 Location: USA
|
Posted: Fri Mar 02, 2007 10:43 pm |
#dbload "C:\mydatabases\npc.db"
Works.
Thing is you can only Access one database at a time, but you can have multiple ones open. So you could do something like.
@npc=%query("Like blah blah blah in here") then #dbload "C:\mydatabases\weapon.db" @weapon=%query("Gee what does this guy wield?")
There are many ways to deal with it but there is a about 1 second delay between loading a database into memory depending on the size of course. So if you made an alias to load all of the databases that you would use wait a few seconds then use your databases with little or no delay. When you are done then close your database window.
The last database that you used #DBLOAD on is the one that you are able to access via the database commands/functions. |
|
_________________ Arminas, The Invisible horseman
Windows 7 Pro 32 bit
AMD 64 X2 2.51 Dual Core, 2 GB of Ram |
|
|
 |
liujc Beginner
Joined: 02 Mar 2007 Posts: 23 Location: China, BeiJing
|
Posted: Sat Mar 03, 2007 4:51 pm |
Thanks a lot!
|
|
|
 |
|
|