Dim db As New odbc_db
Dim db1 As New odbc_db
Dim RPD As New odbc_sql
Dim strSQL As String
Dim y As Long
'データベース接続
With db *******←ここでエラーとなります**********
.Init_ODBC
.rUsr_ID = "hanb"
.rPwd_ID = "hanb"
.rDns = "hanb"
.rNoTran = False
If Not .Open_ODBC(False) Then
.Err_MsgOut
Exit Sub
End If
End With