Database problem

In the following code

[quote] dim rs as recordset = karter.SQLSelect("select * from myeventplanner where PK = "+ str(myeventplannerpk))
karter.SQLSelect (“select currency, measurement, temperature from preferences”)
currency1.text = DefineEncoding(rs.Field(“currency”).stringvalue, encodings.UTF8)
txtdate.text = DefineEncoding(rs.Field(“date”).stringvalue, encodings.UTF8)
txtevent.text = DefineEncoding(rs.Field(“event”).stringvalue, encodings.UTF8)
txtclass.text = DefineEncoding(rs.Field(“class”).stringvalue, encodings.UTF8)
txtclub.text = DefineEncoding(rs.Field(“club”).stringvalue, encodings.UTF8)
txtentryfee.text = DefineEncoding(rs.Field(“entryfee”).stringvalue, encodings.UTF8)
txttrack.text = DefineEncoding(rs.Field(“track”).stringvalue, encodings.UTF8)
txtpractice.text = DefineEncoding(rs.Field(“practice”).stringvalue, encodings.UTF8)
txtaccom.text = DefineEncoding(rs.Field(“accom”).stringvalue, encodings.UTF8)
txttransport.text = DefineEncoding(rs.Field(“transport”).stringvalue, encodings.UTF8)
txtfood.text = DefineEncoding(rs.Field(“food”).stringvalue, encodings.UTF8)
txtpit.text = DefineEncoding(rs.Field(“pit”).stringvalue, encodings.UTF8)
txtfuel.text = DefineEncoding(rs.Field(“fuel”).stringvalue, encodings.UTF8)
txtparts.text = DefineEncoding(rs.Field(“parts”).stringvalue, encodings.UTF8)
txtmisc.text = DefineEncoding(rs.Field(“misc”).stringvalue, encodings.UTF8)
txtlease.text = DefineEncoding(rs.Field(“lease”).stringvalue, encodings.UTF8)
txttotal.text = DefineEncoding(rs.Field(“total”).stringvalue, encodings.UTF8)
txtcomments.text = DefineEncoding(rs.Field(“comments”).stringvalue, encodings.UTF8)


I am getting an error in line 2 "You must use the value returned by this function “Karter.SQLselect”

Don’t know where I an going wrong, I am trying to display the value of currency from the database.


rs=karter.SQLSelect (“select currency, measurement, temperature from preferences”)

you have this… and then the same line without the “RS=”

delete that line, or add RS= to it and delete the first line, they have different SQL statements… you can do one or the other

Hi Dave, I am trying to select from 2 different recordsets.

Just had an aha moment and worked it out.

If you want two recordsets then you must define two:

dim rs as recordset = karter.SQLSelect("select * from myeventplanner where PK = "+ str(myeventplannerpk)) dim rs2 as recordset = karter.SQLSelect ("select currency, measurement, temperature from preferences")

edit: I see yo got there in the end.

Thanks Bob, that’s basically what I came up with, still learning but getting there slowly.

No matter how long we code we are always learning.