Error with Adodb and combobox

Peperl
04-20-2004, 03:40 AM
Hi

I have this function to a control that I have created that show a msgbox with a combo.

Before, I tried to create at run-time the dsn, and enlace with a adodc, but now I'm trying to translate that function to a ADODB, but I don't get that this works, 'cos when I see the combo I get the value in the textbox, but the list of items is empty

When I do the connection, I comprobate the GetString property and pick me all the values


AdoConn.ConnectionString = "driver={MySQL ODBC 3.51 driver};server=" & Serv & ";Port=3306;Option=131072;stmt=;database=" & BD & ";uid=" & User & ";Pwd=" & Password
AdoConexion.Open
AdoRecordset.Open StrinConnection, AdoConn, adOpenDynamic, adLockOptimistic, 1

Set CmdRes.RowSource = AdoRecordset
CmdRes.ListField = MyField
CmdRes.Refresh

CmdRes.Text = AdoRecordset.Fields(MyField).Value



does anybody what's wrong in the code?

Thanks

Shurik12
04-20-2004, 03:52 AM
Hi,

You have to loop through the recordset and use .AddItem method of the combobox
to populate it.


Regards,
Shurik.

Peperl
04-20-2004, 03:56 AM
sorry, I explain bad, I am using a datacombo instead a combobox

but, maybe I could use a combobox and try

Shurik12
04-20-2004, 04:13 AM
I'd personally recommend to do so.

Peperl
04-20-2004, 04:18 AM
yes, i tried that method and seems to wroks fine! Thanks very much for the idea

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum