Code:
FORM SECTION Private Sub command1_click() tsql$ = "SELECT empname From employee" tsql$ = tsql$ & "where empid = 1 " Set rs = cn.Execute(tsql, openstatic, LockReadonly) While Not (rs.BOF Or rs.EOF) txtEmployeename.Text = rs(0) rs.MoveNext Wend End Sub Private Sub ee_DragDrop(Source As Control, X As Single, Y As Single) End Sub Private Sub Form_Load() datafile = "C:\database2.accdb" With cn .Provider = "microsoft.ACE.OLEDB.12.0" .ConnectionString = datafile .Open cboTask.Clear End With End Sub MODULE SECTION Global cn As New ADODB.Connection Global rs As New ADODB.Recordset Global datafile As String
When I compile the above code i am getting error message as "user defined type not defined".I have included
Microsoft ADO EXT 2.8 for DDL and Security
Microsoft DAO 3.6 Object library
Comment