scottr
Jul 27th, 1999, 10:38 PM
Hi all,
I have a multiple combo boxes on my form accessing a SQL Server 7.0 database using ADO. I also have the far point spread control that is accessing the data.
This is the code i am using to additems to the combo box
'do the sql statement
SQLStmt = "Select distinct db_name from " & DatabaseName
SQLStmt = gSQLStmt & "database"
RetrieveADO gSQLStmt
'go to the retrieve ado fucntion
'get information back from the server
Do Until RetrieveADO.EOF
combobox1.AddItem RetrieveADORecordset![db_name]
RetrieveADORecordset.MoveNext
Loop
RetrieveADORecordset.Close
I am calling this procedure from the spread click event. The problem is that every time i click the spread it is running through the proceducre. What i want to do is have some code that would read the items in the combo box and if there are items in there, the procedure would stop. I thought about using the clear method to clear out the combo box but i thought this would be ineffeicent because the combobox would still make a trip to the SQL server.
I want to impress my boss, so any help is aprreciated
Thanks
Scott
I have a multiple combo boxes on my form accessing a SQL Server 7.0 database using ADO. I also have the far point spread control that is accessing the data.
This is the code i am using to additems to the combo box
'do the sql statement
SQLStmt = "Select distinct db_name from " & DatabaseName
SQLStmt = gSQLStmt & "database"
RetrieveADO gSQLStmt
'go to the retrieve ado fucntion
'get information back from the server
Do Until RetrieveADO.EOF
combobox1.AddItem RetrieveADORecordset![db_name]
RetrieveADORecordset.MoveNext
Loop
RetrieveADORecordset.Close
I am calling this procedure from the spread click event. The problem is that every time i click the spread it is running through the proceducre. What i want to do is have some code that would read the items in the combo box and if there are items in there, the procedure would stop. I thought about using the clear method to clear out the combo box but i thought this would be ineffeicent because the combobox would still make a trip to the SQL server.
I want to impress my boss, so any help is aprreciated
Thanks
Scott