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
bozo65
Beginner


Joined: 27 Feb 2005
Posts: 11

PostPosted: Sun Feb 27, 2005 6:51 pm   

Variables and ADO
 
hi,

When i assign a zmud variable to a ADO coomand i get this

%tmpcom35369034

eg

target=@rs("Target")

assigns %tmpcom35369304 to target

ie rather than storing the contents of the Target field in target stores what appears to be a point to COM object.

How do you store the field value?

thanks in advance
Reply with quote
nexela
Wizard


Joined: 15 Jan 2002
Posts: 1644
Location: USA

PostPosted: Sun Feb 27, 2005 9:10 pm   
 
Are you accessing it correclty?
_________________
Zmud Support Library
Zmud Knowledge Base
Reply with quote
bozo65
Beginner


Joined: 27 Feb 2005
Posts: 11

PostPosted: Sun Feb 27, 2005 9:23 pm   
 
nexela wrote:
Are you accessing it correclty?


Full trigger script is here. Its finding the row OK and printing the ECHO's out but TARGET is incorrectly assigned.

#VAR rs %comcreate( "ADODB.Recordset")
#VAR connStr "Provider=Microsoft.Jet.OLEDB.4.0;DataSource=mydata.mdb"
#if (@Mobs) {
str=Fred
Sql="SELECT * FROM MobTbl WHERE Name='@str'"
#CALL @rs.Open( @Sql, @ConnStr)
#if (not @rs.eof) {
#ECHO @rs("Name") @rs("ExpGained") @rs("Alignment")
TARGET = @rs( "Target")
#if (@monster=1) {TARGET=monster}
#stop
#play stop.wav
}
#CALL @rs.Close
}
Reply with quote
nexela
Wizard


Joined: 15 Jan 2002
Posts: 1644
Location: USA

PostPosted: Sun Feb 27, 2005 10:56 pm   
 
ya need fields/value I do believe, Also I think the .value is default so you might be able to get away without it

#ECHO @rs.fields("Name").value @rs.fields("ExpGained").value @rs.fields("Alignment").value
TARGET = @rs.fields( "Target").value
_________________
Zmud Support Library
Zmud Knowledge Base
Reply with quote
bozo65
Beginner


Joined: 27 Feb 2005
Posts: 11

PostPosted: Mon Feb 28, 2005 10:15 am   
 
nexela wrote:
TARGET = @rs.fields( "Target").value


Hi nexela

Thanks for that youve solved it!

Im probaby pushing it a bit here but

This queryl works fine.

Sql="SELECT * FROM MobTbl WHERE Name='@str''"

This query generates an unknown error

Sql="SELECT * FROM MobTbl WHERE Name='@str' AND Zone='%zonename''"
Reply with quote
Dharkael
Enchanter


Joined: 05 Mar 2003
Posts: 593
Location: Canada

PostPosted: Thu Mar 03, 2005 4:30 pm   
 
from what i can see the problem is that you've mixed quote characters in the second query
after %zonename you have 2 double quote characters instead of a single quote char followed by a double quote char
_________________
-Dharkael-
"No matter how subtle the wizard, a knife between the shoulder blades will seriously cramp his style."
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