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

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » zMUD General Discussion
Grumpy
Beginner


Joined: 24 May 2004
Posts: 10

PostPosted: Sun Dec 10, 2006 11:00 am   

Some ADO trouble with MySQL
 
I am having trouble inserting/updating items into my MySQL database. Following the ADO help page I setup my MS SQLServer fine. When I open the recordset with the sql select command in MySQL it seems fine because #ECHO @rs.GetString returns the expected data, but after that it just does not work, I have no idea why and I am puzzled because after the record set is populated the procedure should be exactly the same as SQL Server.
Does anyone have any tips for me or better can someone using MySQL post their update/insert scripts?
Reply with quote
nexela
Wizard


Joined: 15 Jan 2002
Posts: 1644
Location: USA

PostPosted: Sun Dec 10, 2006 6:03 pm   
 
I believe this has been converted to cmud so it might not work in zmud without some tweaking of ""'s
This is how I do it to insert into a .mdb file. for a mysql DB I think the only thing that needs to be done is adjusting the connstr


connstr="Provider=Microsoft.Jet.OLEDB.4.0%char( 59)Data Source=legenddb.mdb"
#IF (@auto.herblore=1) {
Herblore.rent=%1
#IF ((!%null( @herblore.rent)) AND (!%null( @herblore.name))) {
#SAY Updating Herblore Database
#PRIORITY {#LOOPDB @herblore {#VARIABLE herblore.%key {%replace( %val, "'", "''")}}}
#VARIABLE query {INSERT INTO `herblore` ( `name` , `rent` , `brew` , `poultice` , `flavor` , `foul` , `amulet` ) VALUES ('@herblore.name', '@herblore.rent', '@herblore.brew' , '@herblore.poultice' , '@herblore.flavor' , '@herblore.foul' , '@herblore.amulet')}
#VARIABLE rs %comcreate( "ADODB.connection")
#CALL @rs.Open(@ConnStr)
#CALL @rs.execute(@query)
#CALL @rs.close
#VARIABLE rs ""
auto.herblore=0
}
}
_________________
Zmud Support Library
Zmud Knowledge Base
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » zMUD 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