how can i retrieve the data from sql-server2005 from multiple tables in two combo-boxes in vb6.0 using programming code
30 pts.
0
Q:
how can i retrieve the data from sql-server2005 from multiple tables in two combo-boxes in vb6.0 using programming code
how can i retrieve the data from sql-server 2005 from multiple tables in two combo-boxes in vb6.0 using programming code
ASKED: Apr 27 2009  9:18 PM GMT
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
0
29855 pts.
0
A:
 RATE THIS ANSWER
0
Click to Vote:
  •   0
  •  0
  • AddThis Social Bookmark Button
Here is an example, using ADO and an ODBC data source to connect to the database:

Dim adoConnection As ADODB.Connection
Dim adoRecordset As ADODB.Recordset
Dim connectString As String

'-Create a new connection --
Set adoConnection = New ADODB.Connection
'-Create a new recordset --
Set adoRecordset = New ADODB.Recordset

'-Build the connection string to use when we open the connection --
connectString = "Data Source=sql;Database=test;Uid=your_username; Pwd=your_password;"

adoConnection.Open connectString
adoRecordset.Open "SELECT t1.field_y FROM table_1 t1 JOIN table_2 t2 ON t1.column_x = t2.column_x", adoConnection

' Populate the combo
Do Until adoRecordset.EOF
Combo1.AddItem adoRecordset!field_y
adoRecordset.MoveNext
Loop
Last Answered: Apr 28 2009  1:49 PM GMT by Carlosdl   29855 pts.
0
0
Discuss This Answer:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _



_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

Alessandro Panzetta   0 pts.  |   Apr 28 2009  6:39AM GMT

Please post the tables structure and which data you would like to be shown.

 

Carlosdl   29855 pts.  |   Apr 28 2009  1:52PM GMT

There is no need to post the table structures; just adapt the above example to your needs.

Feel free to ask if you have any questions.

 
0