Load values to dropdown\Combo from Database in VB6

Add a combo control in the form with name combo2. And use the below code to load the values. Private Sub Form_Load() Dim cn1 As Object Dim rs1, rs2 As Object Set cn1 = CreateObject(“ADODB.Connection”) strConnection = “Provider=Microsoft.ACE.OLEDB.12.0;” & “Data Source=” & “file path” & “Data.mdb” strSql = “SELECT * FROM User_Login;” cn1.Open strConnection Set…

Details

connecting with MS Access database in VB6 through ADODB.Connection

Dim cn As Object Dim rst As Object Dim strConnection As String Dim strSql As String Set cn = CreateObject(“ADODB.Connection”) strConnection = “Provider=Microsoft.ACE.OLEDB.12.0;” & “Data Source=” & “path of the file” & “Data.mdb” strSql = “SELECT * FROM User_Login where User_Id=’username';” cn.Open strConnection Set rst = cn.Execute(strSql) If rst.BOF And rst.EOF Then MsgBox “No data…

Details