Generally Windows recognize the android device as MTP (Media Transfer Protocol) when you connect it with . But some times it does detect its as PTP only or nothing just charging only.
So, this is the case with you that you are connecting your android smartphone with your computer via a micro usb cable but windows is not detecting the smartphone but only charging it.
There are few steps that you need to do in order to check the problem with the connection.
1. Plug the mobile with the USB cable in the computer and on then go to
Settings > Storage > and TAP on the USB icon on the top right corner of the screen > From there select Media Device (MTP).
This step will probably solve your problem and if not?
2. Check if the USB cable is faulty. Use a good quality USB cable that comes with the mobile phone.
3. Under Settings > Storage > USB icon on the top right corner of the screen > Select Camera (PTP) to open camera folder only of the internal storage generally named DCIM.