I hope i'm not on the wrong place, been a while since i logged in.
Hi everyone, i am working on a simple VBA project. i have an MS access database and i want to view its content on excel. i was able to connect to the database and fetch the content of the table.
to make sure that i am getting the table's content, i was able to use message box to show the data that i needed and i see it correctly fetches them
now my problem is, how do i put the data in an excel cell?
below is the code to fetch the data, assuming that connection to DB is OK.
'Set the ADO Recordset object:
Set adoRecSet = New ADODB.Recordset
'Opening the table named Provider:
strTable = "providertbl"
adoRecSet.Open Source:=strTable, ActiveConnection:=connDB, CursorType:=adOpenStatic, LockType:=adLockPessimistic
For i = 0 To adoRecSet.Fields.Count - 1
'get field / column name:
MsgBox adoRecSet.Fields(i).Name
adoRecSet.MoveFirst
Do While Not adoRecSet.EOF
'get record value:
MsgBox adoRecSet.Fields(i).Value
adoRecSet.MoveNext
Loop
Next i
can someone give an idea how to do put the data in a excel cell? thanks a lot.