Calculating the gain for adjusting sound level to X db
You don't need to convert the voltages to dB, just calculate the required gain (as a factor) and then convert this to dB if necessary, i.e.

G = Vout / Vin                 # required gain (factor)

G_dB = 20 * log10(G)           # required gain (dB)


where 

Vin = input voltage
Vout = output voltage


If you really want to work with dB throughout then you can do it like this (should give the same answer):

Vin_dB = 20 * log10(Vin)       # input voltage (dB)

Vout_dB = 20 * log10(Vout)     # output voltage (dB)

G_dB = Vout_dB - Vin_dB        # required gain (dB)

G = 10 ^ (G_dB / 20)           # required gain (factor)