W
Wayne Wengert
I am trying to rewrite a VB6 App in VB.NET but, from what I understand, I
must use ADO/ADOX to create a database. I tried to copy over my o;ld VB6
code that creates the DB, Creates a table and then adds the 1st record (a
contol record). The code that attempts to set the values for that 1st record
has errors claiming it is Read Only? (see relevant code below)
Questions:
1. Why is that recordset ReadOnly?
2. Can I create the table in VB.NET - if so - How?
================== code ====================
myRS = New ADODB.Recordset()
myRS.CursorType = adOpenKeyset
myRS.Open("[" & TableName & "]", myConn, adOpenDynamic, adLockOptimistic)
'*** Create control record ***
With myRS
..AddNew()
..Fields("Unit") = "$$$$"
must use ADO/ADOX to create a database. I tried to copy over my o;ld VB6
code that creates the DB, Creates a table and then adds the 1st record (a
contol record). The code that attempts to set the values for that 1st record
has errors claiming it is Read Only? (see relevant code below)
Questions:
1. Why is that recordset ReadOnly?
2. Can I create the table in VB.NET - if so - How?
================== code ====================
myRS = New ADODB.Recordset()
myRS.CursorType = adOpenKeyset
myRS.Open("[" & TableName & "]", myConn, adOpenDynamic, adLockOptimistic)
'*** Create control record ***
With myRS
..AddNew()
..Fields("Unit") = "$$$$"