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 Goto page Previous  1, 2
Iliev Posted: Tue Jun 21, 2011 1:22 pm
adding entries to sqlite db
aslanthekat
Novice


Joined: 17 Sep 2007
Posts: 44
Location: Missouri

PostPosted: Wed Jul 13, 2011 1:19 pm   
 
The problem definitely seems to be closing the connection. After executing one alias, if I remove the connection string from the second, it fires correctly and doesn't throw the invalid pointer error. I have also noticed that #SQLCLOSE myavdb does not close my connection. After executing that line, the following line still works even though my connection should be closed
Code:
#call @myavdb.Execute("UPDATE dclocation set location='unknown,unknown,unknown' where race='dgn' AND level='1'")
#call @myavdb.close() also does not close the connection.
Reply with quote
Zugg
MASTER


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

PostPosted: Wed Jul 13, 2011 3:54 pm   
 
Try running the #SQLDB command (without any arguments) to see what CMUD thinks the status of the connection is and make sure you are also using the correct name of your connection. In some of your examples you are using "myavdb" for the database name but "@mydb" for the variable name, so make sure you are not confusing the two. The argument to #SQLCLOSE is not the @variable but is the database name used in the initial %sqldb or #SQLDB command.

However, the fact that you can run the Execute query after closing the database doesn't actually mean much. Once your create the SQL COM object, CMUD is not destroying the object when you run SQLCLOSE. The COM object still points to a valid database object. And when you try to run the Execute method, CMUD will automatically re-open the database if it was previously closed.

So in general you should only run the %sqldb or #SQLDB command ONCE to create the COM object. Not sure why you are constantly opening and closing it and I still haven't had a chance to actually track down the invalid pointer error to determine the cause of that.
Reply with quote
aslanthekat
Novice


Joined: 17 Sep 2007
Posts: 44
Location: Missouri

PostPosted: Thu Jul 14, 2011 12:01 am   
 
So I decided to go another route. I wish I would have thought of this before. I created a ssh session and just connected to my database via shell and then I pass the data and commands back and forth between the sessions. This has proven to be much much faster. Cmud doesn't have to parse all that stuff and I don't have to concat everything. Thanks all for the help.
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD General Discussion All times are GMT
Goto page Previous  1, 2
Page 2 of 2

 
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