G
Guest
Hi -- I'm claiming once again that I'm new to this -- and I really am, it's just taking a long time to pick up what I need.
I'm reading through Dobson's book on VB.net and MS Access. I can connect to a database as follows:
Dim m_DB As New ADODB.Connection
Dim m_COB As New ADODB.Recordset
m_DB.Open("Provider=Microsoft.Jet.oledb.4.0;" & _
"Data Source=..\..\report1.mdb;", "Admin", "")
m_COB.ActiveConnection = m_DB
m_COB.Open("Delete * FROM T_Class", , _
ADODB.CursorTypeEnum.adOpenKeyset, _
ADODB.LockTypeEnum.adLockOptimistic)
I have a couple of questions.
First, I have no idea what the adOpenKeyset or adLockOptimistic means, I'm just copying them down. I'd appreciate any insight.
Second, I'd like to create a class with the skeletons of this stuff, for example...
m_DB.Open("Provider=Microsoft.Jet.oledb.4.0;" & _
"Data Source=..\..\report1.mdb;", "Admin", "")
I was thinking I could instantiate something like the m_DB by passing report1.mdb as a parameter. I can't figure out how to do this. I tried to create a class and inherit ADOB.connection -- this doesn't work. It tells me that I can only inherit from a class.
I realize that it's pretty obvious that I don't know what I'm doing, but I'm hoping that someone can clear up a few of these points for me.
Thanks,
Art
I'm reading through Dobson's book on VB.net and MS Access. I can connect to a database as follows:
Dim m_DB As New ADODB.Connection
Dim m_COB As New ADODB.Recordset
m_DB.Open("Provider=Microsoft.Jet.oledb.4.0;" & _
"Data Source=..\..\report1.mdb;", "Admin", "")
m_COB.ActiveConnection = m_DB
m_COB.Open("Delete * FROM T_Class", , _
ADODB.CursorTypeEnum.adOpenKeyset, _
ADODB.LockTypeEnum.adLockOptimistic)
I have a couple of questions.
First, I have no idea what the adOpenKeyset or adLockOptimistic means, I'm just copying them down. I'd appreciate any insight.
Second, I'd like to create a class with the skeletons of this stuff, for example...
m_DB.Open("Provider=Microsoft.Jet.oledb.4.0;" & _
"Data Source=..\..\report1.mdb;", "Admin", "")
I was thinking I could instantiate something like the m_DB by passing report1.mdb as a parameter. I can't figure out how to do this. I tried to create a class and inherit ADOB.connection -- this doesn't work. It tells me that I can only inherit from a class.
I realize that it's pretty obvious that I don't know what I'm doing, but I'm hoping that someone can clear up a few of these points for me.
Thanks,
Art