Download one of these (I suggest the Win98SE OEM version) and use it to create a boot floppy that will have drivers that should work, and then you can install Win98 from the CD. If they don't, I dunno what to tell you. Put the drive into a system that is working and see if it's detected and works properly.
The reason the CD drive won't work when you boot from the hard drive with an OS on it is because it hasn't yet been booted up and been able to load drivers for the CD drive. It is expecting to still be in the same system that it was last used on, all the drivers are loaded for that. When you put it into the new system, Win98 assumes that none of the existing drivers will work since all the hardware is changed.
You could also put the hard drive into another working system, partition and format it (don't forget to set the first partition as "active" in FDISK if it doesn't automatically), and copy the "Win98" directory from the CD to the hard drive. Then put the hard drive back into the new system, boot with the boot floppy, and run setup.exe in the Win98 folder on the hard drive. That will install from the hard drive, and if you leave the folder there afterwards, it makes it easier when you install hardware or software and Win98 insists that it needs the Win98 CD -- it will just look in that directory because that's where it installed from. Once you get Win98 installed that way, hopefully the CD drive will be detected just fine and work; if it doesn't, it may be a bad drive. I can't think of much else.
Oh, and the Win98SE disc isn't bootable, so if you're trying to do that, it's not going to work. If you made a custom bootable CD then ignore this.
🙂