I'm not sure, but I think you'll find that even though you are creating Combotable with only one field, you still need to specify that field in your INSERT statements.

e.g. Try this

myComboDB.SQLExecute("CREATE TABLE Combotable(Combofield text);")
myComboDB.SQLExecute("INSERT INTO Combotable (Combofield) VALUES ('11');") myComboDB.SQLExecute("INSERT INTO Combotable (Combofield) VALUES ('12');") myComboDB.SQLExecute("INSERT INTO Combotable (Combofield) VALUES ('13');") myComboDB.SQLExecute("INSERT INTO Combotable (Combofield) VALUES ('14');") myComboDB.SQLExecute("INSERT INTO Combotable (Combofield) VALUES ('15');") myComboDB.SQLExecute("INSERT INTO Combotable (Combofield) VALUES ('16');")

And I think you'll see some improvement.

Or it could be something else entirely. Hehe.

Cheers,
Tom



On 07/12/2006, at 10:24 PM, Dirk Cleenwerck wrote:

Hi,

I'm trying to connect a  combobox to an in memory database.
This is the code I currently have.

 Dim i As Integer
 myComboDB=new REALSQLDatabase
 Dim rs As RecordSet
 if myComboDB.connect then
   myComboDB.SQLExecute("CREATE TABLE Combotable(Combofield text);")
   myComboDB.SQLExecute("INSERT INTO Combotable VALUES('11');")
   myComboDB.SQLExecute("INSERT INTO Combotable VALUES('12');")
   myComboDB.SQLExecute("INSERT INTO Combotable VALUES('13');")
   myComboDB.SQLExecute("INSERT INTO Combotable VALUES('14');")
   myComboDB.SQLExecute("INSERT INTO Combotable VALUES('15');")
   myComboDB.SQLExecute("INSERT INTO Combotable VALUES('16');")
   DataControl1.Database=myComboDB
   DataControl1.Commit=True
   DataControl1.SQLQuery="select Combofield from Combotable"
   DataControl1.TableName="Combotable"
   Datacontrol1.RunQuery
   ComboBox2.DataSource="DataControl1"
   ComboBox2.DataField="Combofield"
 end if

When I check the .rowcount on the DataControl then I get 6 as expected, but when I click the Combobox, nothing shows up in the dropdown.
What am I doing wrong?

Thanks in advance
Dirk Cleenwerck
Chief programmer
Useitgroup NV
Belgium
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Reply via email to