I need to know where is the error in following code for MS ACCESS connection through ODBC. Can I have the corrected code ?



private Sub Form_Load()
Dim PrivDb as Database
set PrivDb = OpenDatabase("", false, false, "ODBC;DSN=Hospital;UID=xxx;Pwd=xxx;")
End Sub




ODBC setting :
ODBC Driver = Microsoft Access Driver (*.mdb)
DSN = Hospital
Database = C:\Hospital
UID = xxx
PWD = xxx

Note : The above code is working if i change the driver to Sql Server

Thanks.