I'am make a connection with database access 2010
In visual studio 2010, I adding reference microsoft activex data objects 2.7 library and use ADODB
but not recognized the comand adStateOpen :
Dim db as ADODB.Connection
db = CreateObject("ADODB.Connection")
db.Open("Provider='Microsoft.ACE.OLEDB.12.0';Data Source='C:dbAccess.accdb'") // it's ok , I have connection with database
db.state = adStateOpen ' is not recognized , I try to check status of connection
' I tried this code above
if db.state = 1 then
msgbox("connection
work!!!") ' It's work when path the file ok
else
msg("connection failed") ' It's not work path file not ok.
end if
what can I do ?
I uderstant the ADODB is very old , but would like to learn .